Bug 1514725 - Add 'canAccessTab' to tabs API for WebExtensions after bug 1345474; r=darktrojan
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 19 Dec 2018 00:04:35 +1300
changeset 33166 68b96cf5813e
parent 33165 03ca21bafc5f
child 33167 7b1a013aaddb
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1514725, 1345474
Bug 1514725 - Add 'canAccessTab' to tabs API for WebExtensions after bug 1345474; r=darktrojan
mail/components/extensions/parent/ext-mail.js
--- a/mail/components/extensions/parent/ext-mail.js
+++ b/mail/components/extensions/parent/ext-mail.js
@@ -916,16 +916,28 @@ class TabManager extends TabManagerBase 
    *
    * @param {NativeTabInfo} nativeTabInfo       The native tab for which to revoke permissions.
    */
   revokeActiveTabPermission(nativeTabInfo = tabTracker.activeTab) {
     super.revokeActiveTabPermission(nativeTabInfo);
   }
 
   /**
+   * Determines access using extension context.
+   *
+   * @param {NativeTab} nativeTab
+   *        The tab to check access on.
+   * @returns {boolean}
+   *        True if the extension has permissions for this tab.
+   */
+  canAccessTab(nativeTab) {
+    return true;
+  }
+
+  /**
    * Returns a new Tab instance wrapping the given native tab info.
    *
    * @param {NativeTabInfo} nativeTabInfo       The native tab for which to return a wrapper.
    * @return {Tab}                              The wrapped native tab
    */
   wrapTab(nativeTabInfo) {
     return new Tab(this.extension, nativeTabInfo, tabTracker.getId(nativeTabInfo));
   }