Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/requestBlocker.js

Issue 29789571: Backed out changeset 939bf6cdd435 (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created May 24, 2018, 10:32 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dependencies ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « dependencies ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld