Bug 1441982 - Don't set window opener if nsIBrowserDOMWindow.OPEN_NO_OPENER present r=jchen
authorJames Willcox <snorp@snorp.net>
Tue, 06 Mar 2018 13:52:37 -0600
changeset 461863 63a48ae95dd8c9259e5cdbe9030f2ddc8381d3a5
parent 461862 9e915e03ab021bdf4b6fcd6850eaf57e2582a830
child 461864 353bb6fbb68354a90173f5b9a9188b6de756d8e0
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1441982
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1441982 - Don't set window opener if nsIBrowserDOMWindow.OPEN_NO_OPENER present r=jchen MozReview-Commit-ID: 96qL9yL0FUA
mobile/android/modules/geckoview/GeckoViewNavigation.jsm
--- a/mobile/android/modules/geckoview/GeckoViewNavigation.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewNavigation.jsm
@@ -75,17 +75,19 @@ class GeckoViewNavigation extends GeckoV
     if (!aSessionId) {
       return Promise.resolve(null);
     }
 
     return new Promise(resolve => {
       const handler = {
         observe(aSubject, aTopic, aData) {
           if (aTopic === "geckoview-window-created" && aSubject.name === aSessionId) {
-            aSubject.browser.presetOpenerWindow(aOpener);
+            if (aOpener) {
+              aSubject.browser.presetOpenerWindow(aOpener);
+            }
             Services.obs.removeObserver(handler, "geckoview-window-created");
             resolve(aSubject);
           }
         }
       };
 
       // This event is emitted from createBrowser() in geckoview.js
       Services.obs.addObserver(handler, "geckoview-window-created");
@@ -103,17 +105,18 @@ class GeckoViewNavigation extends GeckoV
 
     const message = {
       type: "GeckoView:OnNewSession",
       uri: aUri ? aUri.displaySpec : ""
     };
 
     let browser = undefined;
     this.eventDispatcher.sendRequestForResult(message).then(sessionId => {
-      return this.waitAndSetOpener(sessionId, aOpener);
+      return this.waitAndSetOpener(sessionId,
+        (aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener);
     }).then(window => {
       browser = (window && window.browser);
     }, () => {
       browser = null;
     });
 
     // Wait indefinitely for app to respond with a browser or null
     Services.tm.spinEventLoopUntil(() => browser !== undefined);