Bug 1387890 - Pass parentId for tabs opened by webextensions on Android. r=kmag, a=lizzard
authorJan Henning <jh+bugzilla@buttercookie.de>
Mon, 07 Aug 2017 18:50:25 +0200
changeset 423481 e09c51325c7bf8c1aa69fa843f4843556bbfa74b
parent 423480 8c9f02a4d6ad076ab2021e70607ab12d956aafa5
child 423482 e4f5cc3fbd9360150c9abd0698ae79a3e3758fcd
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, lizzard
bugs1387890
milestone56.0
Bug 1387890 - Pass parentId for tabs opened by webextensions on Android. r=kmag, a=lizzard ... so that pressing the back button eventually closes that tab and returns to the previous tab instead of simply backgrounding Firefox. MozReview-Commit-ID: DuaA3anCsvn
mobile/android/components/extensions/ext-tabs.js
--- a/mobile/android/components/extensions/ext-tabs.js
+++ b/mobile/android/components/extensions/ext-tabs.js
@@ -265,16 +265,18 @@ this.tabs = class extends ExtensionAPI {
           if (createProperties.index !== null) {
             options.tabIndex = createProperties.index;
           }
 
           // Make sure things like about:blank and data: URIs never inherit,
           // and instead always get a NullPrincipal.
           options.disallowInheritPrincipal = true;
 
+          options.parentId = BrowserApp.selectedTab.id;
+
           tabListener.initTabReady();
           let nativeTab = BrowserApp.addTab(url, options);
 
           if (createProperties.url) {
             tabListener.initializingTabs.add(nativeTab);
           }
 
           return tabManager.convert(nativeTab);