Bug 1384964 - Fix pageAction.show/hide/getPopup/setPopup on Android for tabId 0. r=mixedpuppy
authorLuca Greco <lgreco@mozilla.com>
Thu, 27 Jul 2017 18:23:16 +0200
changeset 423045 60076d86bb5cf9a03b8eff93931523e718e1ccea
parent 423044 2ee0b5a0560a0c9f6dfd023dfe8a26c738994bb9
child 423046 5c6a8f30184cbb1dc12be2cadf66d65db2518321
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)
reviewersmixedpuppy
bugs1384964
milestone56.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 1384964 - Fix pageAction.show/hide/getPopup/setPopup on Android for tabId 0. r=mixedpuppy MozReview-Commit-ID: FVcbQkiTGqe
mobile/android/components/extensions/ext-pageAction.js
--- a/mobile/android/components/extensions/ext-pageAction.js
+++ b/mobile/android/components/extensions/ext-pageAction.js
@@ -232,32 +232,32 @@ this.pageAction = class extends Extensio
           };
           pageActionMap.get(extension).on("click", listener);
           return () => {
             pageActionMap.get(extension).off("click", listener);
           };
         }).api(),
 
         show(tabId) {
-          let tab = tabId ? tabTracker.getTab(tabId) : null;
+          let tab = tabTracker.getTab(tabId);
           return pageActionMap.get(extension).setProperty(tab, "show", true);
         },
 
         hide(tabId) {
-          let tab = tabId ? tabTracker.getTab(tabId) : null;
+          let tab = tabTracker.getTab(tabId);
           pageActionMap.get(extension).setProperty(tab, "show", false);
         },
 
         setPopup(details) {
-          let tab = details.tabId ? tabTracker.getTab(details.tabId) : null;
+          let tab = tabTracker.getTab(details.tabId);
           let url = details.popup && context.uri.resolve(details.popup);
           pageActionMap.get(extension).setProperty(tab, "popup", url);
         },
 
         getPopup(details) {
-          let tab = details.tabId ? tabTracker.getTab(details.tabId) : null;
+          let tab = tabTracker.getTab(details.tabId);
           let popup = pageActionMap.get(extension).getProperty(tab, "popup");
           return Promise.resolve(popup);
         },
       },
     };
   }
 };