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

Unified Diff: lib/filterListener.js

Issue 29790555: Issue 6671 - Introduce trusted subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Make user's own filters trusted Created May 25, 2018, 6:41 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/filterClasses.js ('k') | lib/subscriptionClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -141,16 +141,31 @@
for (let i = 0; i < filter.subscriptions.length; i++)
{
if (!filter.subscriptions[i].disabled)
hasEnabled = true;
}
if (!hasEnabled)
return;
+ if (filter.needsTrust)
+ {
+ let hasTrust = false;
+ for (let i = 0; i < filter.subscriptions.length; i++)
+ {
+ if (filter.subscriptions[i].trusted)
+ {
+ hasTrust = true;
+ break;
+ }
+ }
+ if (!hasTrust)
+ return;
+ }
+
if (filter instanceof RegExpFilter)
defaultMatcher.add(filter);
else if (filter instanceof ElemHideBase)
{
if (filter instanceof ElemHideEmulationFilter)
ElemHideEmulation.add(filter);
else
ElemHide.add(filter);
« no previous file with comments | « lib/filterClasses.js ('k') | lib/subscriptionClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld