Bug 1308688 r=kmag
authorAndrew Swan <aswan@mozilla.com>
Tue, 29 Nov 2016 11:49:03 -0800
changeset 324726 72ff2080ca120c16fd3b035c54b9ae8957fe83ed
parent 324725 dfb42f181ef9ada2ebce56d4f1beb0eb857b5487
child 324727 d254eb61360d3c20172eb7aba1154e2779850263
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerskmag
bugs1308688
milestone53.0a1
Bug 1308688 r=kmag 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);