ignore did-fail-load error code -3

bug with in-app-menu
This commit is contained in:
Araxeus
2021-05-04 02:04:17 +03:00
parent d5b9e3c960
commit fb81e1bdd5
2 changed files with 6 additions and 5 deletions

View File

@ -160,7 +160,7 @@ app.once("browser-window-created", (event, win) => {
loadPlugins(win); loadPlugins(win);
win.webContents.on("did-fail-load", ( win.webContents.on("did-fail-load", (
event, _event,
errorCode, errorCode,
errorDescription, errorDescription,
validatedURL, validatedURL,
@ -170,7 +170,6 @@ app.once("browser-window-created", (event, win) => {
) => { ) => {
const log = JSON.stringify({ const log = JSON.stringify({
error: "did-fail-load", error: "did-fail-load",
event,
errorCode, errorCode,
errorDescription, errorDescription,
validatedURL, validatedURL,
@ -181,8 +180,10 @@ app.once("browser-window-created", (event, win) => {
if (is.dev()) { if (is.dev()) {
console.log(log); console.log(log);
} }
win.webContents.send("log", log); if( !(config.plugins.isEnabled("in-app-menu") && errorCode === -3)) { // -3 is a false positive with in-app-menu
win.webContents.loadFile(path.join(__dirname, "error.html")); win.webContents.send("log", log);
win.webContents.loadFile(path.join(__dirname, "error.html"));
}
}); });
win.webContents.on("will-prevent-unload", (event) => { win.webContents.on("will-prevent-unload", (event) => {

View File

@ -7,7 +7,7 @@ function logToString(log) {
} }
module.exports = () => { module.exports = () => {
ipcRenderer.on("log", (event, log) => { ipcRenderer.on("log", (_event, log) => {
console.log(logToString(log)); console.log(logToString(log));
}); });
}; };