Bug 723156 - Fix the back button for new windows opened by frames [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 10 Feb 2012 13:21:32 -0800
changeset 86636 7d0691b7e2ca08576a988cb7a0b5e5278fb90b62
parent 86635 1f30e16bf02d2d697b83c454bbcb9eae1fda65b4
child 86637 cb4532333feb9e6640f4f15c874555eed09d9fc4
push idunknown
push userunknown
push dateunknown
reviewersmfinkle
bugs723156
milestone13.0a1
Bug 723156 - Fix the back button for new windows opened by frames [r=mfinkle]
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1374,17 +1374,17 @@ nsBrowserAccess.prototype = {
           aWhere = Services.prefs.getIntPref("browser.link.open_newwindow");
       }
     }
 
     let newTab = (aWhere == Ci.nsIBrowserDOMWindow.OPEN_NEWWINDOW || aWhere == Ci.nsIBrowserDOMWindow.OPEN_NEWTAB);
 
     let parentId = -1;
     if (newTab && !isExternal) {
-      let parent = BrowserApp.getTabForBrowser(BrowserApp.getBrowserForWindow(aOpener));
+      let parent = BrowserApp.getTabForBrowser(BrowserApp.getBrowserForWindow(aOpener.top));
       if (parent)
         parentId = parent.id;
     }
 
     let browser;
     if (newTab) {
       let tab = BrowserApp.addTab("about:blank", { external: isExternal, parentId: parentId, selected: true });
       browser = tab.browser;