diff --git a/installer/mac/postinstall.sh b/installer/mac/postinstall.sh index 08beeefc..b39ce925 100755 --- a/installer/mac/postinstall.sh +++ b/installer/mac/postinstall.sh @@ -45,10 +45,10 @@ fi rm -f $tempFilePath ## For launching symphony with sandbox enabled, create a shell script that is used as the launch point for the app -EXEC_PATH=$installPath/Symphony.app/Contents/MacOS -mv $EXEC_PATH/Symphony $EXEC_PATH/Symphony-bin -cat > $EXEC_PATH/Symphony << EOT -#!/bin/sh -exec "\${0%/*}/Symphony-bin" --enable-sandbox \$@ -EOT -chmod 755 $EXEC_PATH/Symphony \ No newline at end of file +# EXEC_PATH=$installPath/Symphony.app/Contents/MacOS +# mv $EXEC_PATH/Symphony $EXEC_PATH/Symphony-bin +# cat > $EXEC_PATH/Symphony << EOT +# #!/bin/sh +# exec "\${0%/*}/Symphony-bin" --enable-sandbox \$@ +# EOT +# chmod 755 $EXEC_PATH/Symphony \ No newline at end of file diff --git a/js/notify/electron-notify.js b/js/notify/electron-notify.js index bf053d41..98d793aa 100644 --- a/js/notify/electron-notify.js +++ b/js/notify/electron-notify.js @@ -48,6 +48,8 @@ let externalDisplay; // user selected display id for notification let displayId; +let sandboxed = false; + let config = { // corner to put notifications // upper-right, upper-left, lower-right, lower-left @@ -131,7 +133,7 @@ let config = { acceptFirstMouse: true, webPreferences: { preload: path.join(__dirname, 'electron-notify-preload.js'), - sandbox: !isNodeEnv, + sandbox: sandboxed, nodeIntegration: isNodeEnv } } diff --git a/js/notify/settings/configure-notification-position.js b/js/notify/settings/configure-notification-position.js index 070a156d..52c72ffe 100644 --- a/js/notify/settings/configure-notification-position.js +++ b/js/notify/settings/configure-notification-position.js @@ -17,6 +17,7 @@ let configurationWindow; let screens; let position; let display; +let sandboxed = false; let windowConfig = { width: 460, @@ -27,7 +28,7 @@ let windowConfig = { resizable: false, webPreferences: { preload: path.join(__dirname, 'configure-notification-position-preload.js'), - sandbox: true, + sandbox: sandboxed, nodeIntegration: false } }; diff --git a/js/windowMgr.js b/js/windowMgr.js index def70ddb..d0a92581 100644 --- a/js/windowMgr.js +++ b/js/windowMgr.js @@ -37,6 +37,7 @@ let boundsChangeWindow; let alwaysOnTop = false; let position = 'lower-right'; let display; +let sandboxed = false; // note: this file is built using browserify in prebuild step. const preloadMainScript = path.join(__dirname, 'preload/_preloadMain.js'); @@ -81,7 +82,7 @@ function doCreateMainWindow(initialUrl, initialBounds) { minHeight: MIN_HEIGHT, alwaysOnTop: false, webPreferences: { - sandbox: !isNodeEnv, + sandbox: sandboxed, nodeIntegration: isNodeEnv, preload: preloadMainScript, } @@ -212,6 +213,9 @@ function doCreateMainWindow(initialUrl, initialBounds) { // bug in electron is preventing this from working in sandboxed evt... // https://github.com/electron/electron/issues/8841 mainWindow.webContents.on('will-navigate', function(event, willNavUrl) { + if (!sandboxed) { + return; + } event.preventDefault(); openUrlInDefaultBrower(willNavUrl); });