Bug 1386533 fix host permitted matching, r?kmag
MozReview-Commit-ID: 81ANT5R1671
--- 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;