From f5c549df0adb14c880319d0e757698f0452ef58b Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 19 Apr 2018 16:45:40 -0400 Subject: you can add a proxy to the desktop build with --proxy --- electron_js/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/electron_js/main.js b/electron_js/main.js index bac574d9..5856093c 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -6,6 +6,7 @@ const {dialog} = require('electron') // Module to create native browser window. const {BrowserWindow} = electron; var isFs = false; +var isProxy = false; var argv = require('minimist')(process.argv.slice(1)); console.log ("ARGV="+JSON.stringify(argv)); @@ -69,6 +70,9 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { webPreferences:{nodeIntegration:false}}); + + + win.webContents.session.webRequest.onHeadersReceived({}, (d, c) => { if(d.responseHeaders['x-frame-options'] || d.responseHeaders['X-Frame-Options']){ delete d.responseHeaders['x-frame-options']; @@ -86,7 +90,10 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { } - + if (argv.proxy) { + console.log ("PROXY SET: "+argv.proxy); + win.webContents.session.setProxy({proxyRules:argv.proxy}, function() {}); + } // and load the index.html of the app. win.loadURL(`file://${__dirname}/index.html`); -- cgit v1.2.3