Bug 1386533 - Fix host permitted matching. r=kmag, a=lizzard DEVEDITION_56_0b2_RELEASE FIREFOX_56_0b2_BUILD1 FIREFOX_56_0b2_RELEASE
authorShane Caraveo <scaraveo@mozilla.com>
Wed, 02 Aug 2017 15:33:17 -0700
changeset 646770 2638feb177dd9104a3887fae2ce05931a6b41d6c
parent 646769 57026202f82d42b14c8b4b5a2c2b7035f4a3a215
child 646771 f7e05dffb1ab4e0b9ed46fa2350c3b5fd4b9efe4
push id74225
push usercatlee@mozilla.com
push dateTue, 15 Aug 2017 19:06:14 +0000
reviewerskmag, lizzard
bugs1386533
milestone56.0
Bug 1386533 - Fix host permitted matching. r=kmag, a=lizzard MozReview-Commit-ID: 81ANT5R1671
toolkit/modules/addons/WebRequest.jsm
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -843,18 +843,22 @@ HttpObserverManager = {
     let URI = getFinalChannelURI(channel);
     if (URI && isHostPermitted(URI.host)) {
       return false;
     }
 
     let {loadInfo} = channel;
     if (loadInfo && loadInfo.loadingPrincipal) {
       let {loadingPrincipal} = loadInfo;
-
-      return loadingPrincipal.URI && !isHostPermitted(loadingPrincipal.URI.host);
+      try {
+        return loadingPrincipal.URI && !isHostPermitted(loadingPrincipal.URI.host);
+      } catch (e) {
+        // about:newtab and other non-host URIs will throw.  Those wont be in
+        // the host permitted list, so we pass on the error.
+      }
     }
 
     return true;
   },
 
   runChannelListener(channel, loadContext = null, kind, extraData = null) {
     let handlerResults = [];
     let requestHeaders;