Skip to content

Commit

Permalink
Proxy related settings used in any other electron app setting proxy f…
Browse files Browse the repository at this point in the history
…or current app too
  • Loading branch information
gmastergreatee committed Sep 6, 2022
1 parent 634495b commit bdcd440
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if (!gotTheLock) {
app.quit();
}

app.commandLine.appendSwitch('disable-site-isolation-trials');
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors');
app.commandLine.appendSwitch("disable-site-isolation-trials");
app.commandLine.appendSwitch("disable-features", "OutOfBlinkCors");

const path = require("path");
var { http, https } = require("follow-redirects");
Expand Down Expand Up @@ -108,7 +108,7 @@ const createWindow = () => {
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
let url = details.url.toLowerCase();
if (!(url.startsWith("file://") || url.startsWith("devtools://"))) {
details.responseHeaders["access-control-allow-origin"] = "*";
details.responseHeaders["access-control-allow-origin"] = "*";
}
callback({ responseHeaders: details.responseHeaders });
});
Expand Down Expand Up @@ -148,6 +148,8 @@ const createWindow = () => {
// mainWindow.loadURL("http://localhost:5500/index.html");
mainWindow.loadFile(path.join(__dirname, "index.html"));

session.defaultSession.setProxy({ proxyRules: null });

// Open the DevTools.
// mainWindow.webContents.openDevTools();
};
Expand Down

0 comments on commit bdcd440

Please sign in to comment.