Fix electron version checking
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user