Bug 1308688 r=kmag a=gchang
authorAndrew Swan <aswan@mozilla.com>
Tue, 29 Nov 2016 11:49:03 -0800
changeset 349407 150c4dd9fd307b565e882543e10901b176c09639
parent 349406 6a3264ad059fd8def560e753ccc5ee60cd72a724
child 349408 be3e241d379879d78657bd09257d4ec87d0c64e9
push id10381
push usercbook@mozilla.com
push dateWed, 30 Nov 2016 15:33:29 +0000
treeherdermozilla-aurora@a065f231fb79 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, gchang
bugs1308688
milestone52.0a2
Bug 1308688 r=kmag a=gchang MozReview-Commit-ID: IinAfopVsw8
toolkit/modules/addons/.eslintrc.js
toolkit/modules/addons/WebRequest.jsm
--- a/toolkit/modules/addons/.eslintrc.js
+++ b/toolkit/modules/addons/.eslintrc.js
@@ -3,12 +3,13 @@
 module.exports = { // eslint-disable-line no-undef
   "extends": "../../components/extensions/.eslintrc.js",
 
   "globals": {
     "addEventListener": false,
     "addMessageListener": false,
     "removeEventListener": false,
     "sendAsyncMessage": false,
+    "AddonManagerPermissions": false,
 
     "initialProcessData": true,
   },
 };
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -709,17 +709,20 @@ HttpObserverManager = {
 
         if (includeStatus) {
           mergeStatus(data, channel, kind);
         }
 
         try {
           let result = callback(data);
 
-          if (result && typeof result === "object" && opts.blocking) {
+          if (result && typeof result === "object" && opts.blocking
+              && !AddonManagerPermissions.isHostPermitted(uri.host)
+              && loadInfo && loadInfo.loadingPrincipal && loadInfo.loadingPrincipal.URI
+              && !AddonManagerPermissions.isHostPermitted(loadInfo.loadingPrincipal.URI.host)) {
             handlerResults.push({opts, result});
           }
         } catch (e) {
           Cu.reportError(e);
         }
       }
     } catch (e) {
       Cu.reportError(e);