Fix about:blank popups (Vencord QuickCss) (#256)

This commit is contained in:
Ven 2022-11-19 19:04:14 +01:00 committed by GitHub
parent 5d80d44fc8
commit a3eea0b6ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,7 @@ async function doAfterDefiningTheWindow() {
vibe.applyEffect(mainWindow, "acrylic");
vibe.setDarkMode(mainWindow);
mainWindow.show();
});
});
}
var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning");
await checkIfConfigIsBroken();
@ -84,6 +84,9 @@ async function doAfterDefiningTheWindow() {
});
}
mainWindow.webContents.setWindowOpenHandler(({url}) => {
// Allow about:blank (used by Vencord QuickCss popup)
if (url === "about:blank") return { action: "allow" };
if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) {
shell.openExternal(url);
} else {
@ -137,7 +140,7 @@ async function doAfterDefiningTheWindow() {
favicon = nodeList[i].getAttribute("href");
}
}
return favicon;
return favicon;
}
getFavicon()
`);