Bug 1308688. r=kmag, a=gchang
☠☠ backed out by b28660caae81 ☠ ☠
authorAndrew Swan <aswan@mozilla.com>
Wed, 30 Nov 2016 18:04:58 -0500
changeset 356822 82e0d9a22463a20649f21791e419634f9a0d7f7a
parent 356821 9b936f748c46eadf73ea923faebacafe14934de2
child 356823 dc8e1a16537181301bc1f15d3f45898b22cda3be
push id6643
push userryanvm@gmail.com
push dateWed, 30 Nov 2016 23:08:38 +0000
treeherdermozilla-beta@600eda864ff4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, gchang
bugs1308688
milestone51.0
Bug 1308688. r=kmag, a=gchang
toolkit/modules/addons/.eslintrc
toolkit/modules/addons/WebRequest.jsm
--- a/toolkit/modules/addons/.eslintrc
+++ b/toolkit/modules/addons/.eslintrc
@@ -1,12 +1,13 @@
 {
   "extends": "../../components/extensions/.eslintrc",
 
   "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
@@ -597,19 +597,23 @@ HttpObserverManager = {
 
       let result = null;
       try {
         result = callback(data);
       } catch (e) {
         Cu.reportError(e);
       }
 
-      if (!result || !opts.blocking) {
+      if (!result || !opts.blocking
+          || AddonManagerPermissions.isHostPermitted(uri.host)
+          || !loadInfo || !loadInfo.loadingPrincipal.URI
+          || AddonManagerPermissions.isHostPermitted(loadInfo.loadingPrincipal.URI.host)) {
         continue;
       }
+
       if (result.cancel) {
         channel.cancel(Cr.NS_ERROR_ABORT);
         this.errorCheck(channel, loadContext);
         return false;
       }
       if (result.redirectUrl) {
         channel.redirectTo(BrowserUtils.makeURI(result.redirectUrl));
         return false;