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 423500 2638feb177dd9104a3887fae2ce05931a6b41d6c
parent 423499 57026202f82d42b14c8b4b5a2c2b7035f4a3a215
child 423501 f7e05dffb1ab4e0b9ed46fa2350c3b5fd4b9efe4
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;