mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-28 17:24:39 -06:00
SDA-48 - force sandbox for all BrowserWindow instances (#814)
This commit is contained in:
parent
bf6dfb1f16
commit
ecf5c71958
@ -11,7 +11,8 @@
|
|||||||
"main": "lib/src/app/init.js",
|
"main": "lib/src/app/init.js",
|
||||||
"types": "lib/src/app/init.d.ts",
|
"types": "lib/src/app/init.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"browserify-preload": "browserify -o lib/src/renderer/_preload-main.js -x electron --insert-global-vars=__filename,__dirname lib/src/renderer/preload-main.js",
|
"browserify-preload": "browserify -o lib/src/renderer/_preload-main.js -x electron --insert-global-vars=__filename,__dirname lib/src/renderer/preload-main.js && npm run browserify-preload-component",
|
||||||
|
"browserify-preload-component": "browserify -o lib/src/renderer/_preload-component.js -x electron --insert-global-vars=__filename,__dirname lib/src/renderer/preload-component.js",
|
||||||
"compile": "npm run lint && gulp build",
|
"compile": "npm run lint && gulp build",
|
||||||
"dev": "npm run prebuild && cross-env ELECTRON_DEV=true electron .",
|
"dev": "npm run prebuild && cross-env ELECTRON_DEV=true electron .",
|
||||||
"demo-win": "npm run prebuild && cross-env ELECTRON_DEV=true electron . --url=file:///src/demo/index.html",
|
"demo-win": "npm run prebuild && cross-env ELECTRON_DEV=true electron . --url=file:///src/demo/index.html",
|
||||||
@ -94,7 +95,7 @@
|
|||||||
"browserify": "16.2.3",
|
"browserify": "16.2.3",
|
||||||
"cross-env": "5.2.0",
|
"cross-env": "5.2.0",
|
||||||
"del": "3.0.0",
|
"del": "3.0.0",
|
||||||
"electron": "6.1.2",
|
"electron": "6.1.5",
|
||||||
"electron-builder": "21.2.0",
|
"electron-builder": "21.2.0",
|
||||||
"electron-builder-squirrel-windows": "20.38.3",
|
"electron-builder-squirrel-windows": "20.38.3",
|
||||||
"electron-icon-maker": "0.0.4",
|
"electron-icon-maker": "0.0.4",
|
||||||
|
@ -10,6 +10,9 @@ import { appStats } from './stats';
|
|||||||
const userDataPathArg: string | null = getCommandLineArgs(process.argv, '--userDataPath=', false);
|
const userDataPathArg: string | null = getCommandLineArgs(process.argv, '--userDataPath=', false);
|
||||||
const userDataPath = userDataPathArg && userDataPathArg.substring(userDataPathArg.indexOf('=') + 1);
|
const userDataPath = userDataPathArg && userDataPathArg.substring(userDataPathArg.indexOf('=') + 1);
|
||||||
|
|
||||||
|
// force sandbox: true for all BrowserWindow instances.
|
||||||
|
app.enableSandbox();
|
||||||
|
|
||||||
// need to set this explicitly if using Squirrel
|
// need to set this explicitly if using Squirrel
|
||||||
// https://www.electron.build/configuration/configuration#Configuration-squirrelWindows
|
// https://www.electron.build/configuration/configuration#Configuration-squirrelWindows
|
||||||
app.setAppUserModelId('com.symphony.electron-desktop');
|
app.setAppUserModelId('com.symphony.electron-desktop');
|
||||||
|
@ -117,7 +117,7 @@ export const createComponentWindow = (
|
|||||||
width: 300,
|
width: 300,
|
||||||
...opts,
|
...opts,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, '../renderer/preload-component'),
|
preload: path.join(__dirname, '../renderer/_preload-component.js'),
|
||||||
devTools: false,
|
devTools: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user