Browse Source

Merge pull request #10264 from electron/fix-sandbox-crash-on-background-tab

Fix sandbox crash when opening a background tab
Cheng Zhao 7 years ago
parent
commit
f6792c0232
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib/browser/api/browser-window.js

+ 3 - 2
lib/browser/api/browser-window.js

@@ -43,8 +43,9 @@ BrowserWindow.prototype._init = function () {
                                             userGesture, left, top, width,
                                             height) => {
     let urlFrameName = v8Util.getHiddenValue(webContents, 'url-framename')
-    if ((disposition !== 'foreground-tab' && disposition !== 'new-window') ||
-        !urlFrameName) {
+    if ((disposition !== 'foreground-tab' && disposition !== 'new-window' &&
+         disposition !== 'background-tab') || !urlFrameName) {
+      event.preventDefault()
       return
     }