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

Unified Diff: lib/requestBlocker.js

Issue 29737561: Issue 6539, 6782 - Implement support for snippets (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created March 30, 2018, 8:25 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 | « lib/devtools.js ('k') | lib/snippets.js » ('j') | lib/snippets.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/requestBlocker.js
===================================================================
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -62,20 +62,21 @@
for (let type in browser.webRequest.ResourceType)
yield resourceTypes.get(browser.webRequest.ResourceType[type]) || "OTHER";
// WEBRTC gets addressed through a workaround, even if the webRequest API is
// lacking support to block this kind of a request.
yield "WEBRTC";
- // POPUP, CSP and ELEMHIDE filters aren't mapped to resource types.
+ // POPUP, CSP, SNIPPET and ELEMHIDE filters aren't mapped to resource types.
yield "POPUP";
yield "ELEMHIDE";
Manish Jethani 2018/03/31 08:09:40 Just rearranged this for consistency.
yield "CSP";
+ yield "SNIPPET";
}());
function onBeforeRequestAsync(page, url, type, docDomain,
thirdParty, sitekey,
specificOnly, filter)
{
if (filter)
FilterNotifier.emit("filter.hitCount", filter, 0, 0, page);
@@ -93,17 +94,16 @@
ext.webRequest.onBeforeRequest.addListener((url, type, page, frame) =>
{
let docDomain = null;
let sitekey = null;
let specificOnly = false;
let thirdParty = false;
let urlString = stringifyURL(url);
-
if (frame && page)
{
if (checkWhitelisted(page, frame))
return true;
docDomain = extractHostFromFrame(frame);
sitekey = getKey(page, frame);
thirdParty = isThirdParty(url, docDomain);
« no previous file with comments | « lib/devtools.js ('k') | lib/snippets.js » ('j') | lib/snippets.js » ('J')

Powered by Google App Engine
This is Rietveld