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 34020 68b96cf5813e16e0381d873c6b1fa49943a63214
parent 34019 03ca21bafc5f15c817e7ee7e8bec9331d5eab092
child 34021 7b1a013aaddbe105aeacc6f7bd7a103b74f8c185
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
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));
   }