Bug 825016 - Part 1 - When opening a new tab, pass the ID of the parent tab. r=zer0 draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Wed, 09 Mar 2016 21:14:59 +0100
changeset 349500 e40542ff432a37184b5817dbe61e1f9d5b9d6ed2
parent 349384 e847cfcb315f511f4928b03fd47dcf57aad05e1e
child 518116 705c2cd84dec7984ee47e8a7b17ba0f1e3124f06
push id15105
push usermozilla@buttercookie.de
push dateMon, 11 Apr 2016 18:07:42 +0000
reviewerszer0
bugs825016
milestone48.0a1
Bug 825016 - Part 1 - When opening a new tab, pass the ID of the parent tab. r=zer0 This ensures that when hitting back, we return to the previously opened tab. MozReview-Commit-ID: 287AOQnmwxb
addon-sdk/source/lib/sdk/tabs/utils.js
--- a/addon-sdk/source/lib/sdk/tabs/utils.js
+++ b/addon-sdk/source/lib/sdk/tabs/utils.js
@@ -133,17 +133,18 @@ function getWindowHoldingTab(rawTab) {
 function openTab(window, url, options) {
   options = options || {};
 
   // fennec?
   if (window.BrowserApp) {
     return window.BrowserApp.addTab(url, {
       selected: options.inBackground ? false : true,
       pinned: options.isPinned || false,
-      isPrivate: options.isPrivate || false
+      isPrivate: options.isPrivate || false,
+      parentId: window.BrowserApp.selectedTab.id
     });
   }
 
   // firefox
   let newTab = window.gBrowser.addTab(url);
   if (!options.inBackground) {
     activateTab(newTab);
   }