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

Unified Diff: lib/devtools.js

Issue 29991594: Issue 7243 - Update adblockpluscore dependency to hg:e26e122e0702 (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Compare CSP filters by text Created Jan. 31, 2019, 2:49 a.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/csp.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/devtools.js
===================================================================
--- a/lib/devtools.js
+++ b/lib/devtools.js
@@ -80,17 +80,23 @@
// Ignore partial (e.g. ELEMHIDE) whitelisting if there is already
// a DOCUMENT exception which disables all means of blocking.
(record.request.type == "DOCUMENT" ?
nonRequestTypes.includes(request.type) :
record.request.type == request.type) &&
// Matched element hiding filters don't relate to a particular request,
// so we have to compare the selector in order to avoid duplicates.
- (record.filter && record.filter.selector) == (filter && filter.selector)
+ (record.filter && record.filter.selector) == (filter && filter.selector) &&
+
+ // We apply multiple CSP filters to a document, but we must still remove
+ // any duplicates. Two CSP filters are duplicates if both have identical
+ // text.
+ (record.filter && record.filter.csp && record.filter.text) ==
+ (filter && filter.csp && filter.text)
);
}
function addRecord(panel, request, filter)
{
if (!hasRecord(panel, request, filter))
{
panel.port.postMessage({
« no previous file with comments | « lib/csp.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld