Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -184,46 +184,27 @@ |
return; |
let type = resourceTypes.get(details.type) || "OTHER"; |
let [docDomain, sitekey, specificOnly] = getDocumentInfo(page, frame, |
originUrl); |
let [filter, thirdParty] = matchRequest(url, type, docDomain, |
sitekey, specificOnly); |
- let result; |
- let rewrittenUrl; |
- |
- if (filter instanceof BlockingFilter) |
- { |
- if (filter.rewrite) |
- { |
- rewrittenUrl = filter.rewriteUrl(details.url); |
- // If no rewrite happened (error, different origin), we'll |
- // return undefined in order to avoid an "infinite" loop. |
- if (rewrittenUrl != details.url) |
- result = {redirectUrl: rewrittenUrl}; |
- } |
- else |
- result = {cancel: true}; |
- } |
- |
getRelatedTabIds(details).then(tabIds => |
{ |
logRequest( |
tabIds, |
- { |
- url: details.url, type, docDomain, thirdParty, |
- sitekey, specificOnly, rewrittenUrl |
- }, |
+ {url: details.url, type, docDomain, thirdParty, sitekey, specificOnly}, |
filter |
); |
}); |
- return result; |
+ if (filter instanceof BlockingFilter) |
+ return {cancel: true}; |
}, {urls: ["<all_urls>"]}, ["blocking"]); |
port.on("filters.collapse", (message, sender) => |
{ |
let {page, frame} = sender; |
if (checkWhitelisted(page, frame)) |
return false; |