Fix electron version checking

This commit is contained in:
LukeGus
2025-09-28 19:00:43 -05:00
parent 67ab3e50ff
commit 60b4040f11
13 changed files with 1783 additions and 144 deletions

View File

@@ -3,6 +3,11 @@ const path = require("path");
const fs = require("fs");
const os = require("os");
app.commandLine.appendSwitch('--ignore-certificate-errors');
app.commandLine.appendSwitch('--ignore-ssl-errors');
app.commandLine.appendSwitch('--ignore-certificate-errors-spki-list');
app.commandLine.appendSwitch('--enable-features=NetworkService');
let mainWindow = null;
const isDev = process.env.NODE_ENV === "development" || !app.isPackaged;
@@ -35,7 +40,7 @@ function createWindow() {
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
webSecurity: !isDev,
webSecurity: true,
preload: path.join(__dirname, "preload.js"),
},
show: false,
@@ -57,6 +62,16 @@ function createWindow() {
mainWindow.show();
});
mainWindow.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => {
callback({ requestHeaders: details.requestHeaders });
});
mainWindow.webContents.session.cookies.onChanged((event, cookie, cause, removed) => {
if (!removed) {
console.log('Cookie set:', cookie.name, 'for domain:', cookie.domain);
}
});
mainWindow.webContents.on(
"did-fail-load",
(event, errorCode, errorDescription, validatedURL) => {