Bug 1308688 r=kmag
authorAndrew Swan <aswan@mozilla.com>
Tue, 29 Nov 2016 11:49:03 -0800
changeset 324670 72ff2080ca120c16fd3b035c54b9ae8957fe83ed
parent 324669 dfb42f181ef9ada2ebce56d4f1beb0eb857b5487
child 324671 d254eb61360d3c20172eb7aba1154e2779850263
push id84467
push useraswan@mozilla.com
push dateTue, 29 Nov 2016 19:55:39 +0000
treeherdermozilla-inbound@72ff2080ca12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1308688
milestone53.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 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);