Skip loadaucmds when no config for cmdType

Fixes #4487
This commit is contained in:
Pascal Jufer 2023-01-11 14:59:23 +01:00 committed by GitHub
parent 0c84485e8b
commit 149569c676
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2359,6 +2359,7 @@ if (fullscreenApiIsPrefixed) {
//#content
export async function loadaucmds(cmdType: "DocStart" | "DocLoad" | "DocEnd" | "TabEnter" | "TabLeft" | "FullscreenEnter" | "FullscreenLeft" | "FullscreenChange" | "UriChange" | "HistoryState") {
const aucmds = await config.getAsync("autocmds", cmdType)
if (!aucmds) return
const ausites = Object.keys(aucmds)
const aukeyarr = ausites.filter(e => window.document.location.href.search(e) >= 0)
const owntab = await ownTab()