Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addFilter(filter)
{
if (!(filter instanceof ActiveFilter) || filter.disabled)
return;
let hasEnabled = false;
for (let i = 0; i < filter.subscriptions.length; i++)
if (!filter.subscriptions[i].disabled)
hasEnabled = true;
if (!hasEnabled)
return;
if (filter instanceof RegExpFilter)
defaultMatcher.add(filter);
else if (filter instanceof ElemHideBase)
{
if (filter instanceof CSSPropertyFilter)
CSSRules.add(filter);
else
ElemHide.add(filter);
}
}
}
var hasEnabled = false;
for (var i = 0; i < filter.subscriptions.length; i++)
{
if (!filter.subscriptions[i].disabled)
{
hasEnabled = true;
}
}
if (!hasEnabled)
{
return;
}
if (filter instanceof RegExpFilter)
{
defaultMatcher.add(filter);
}
else if (filter instanceof ElemHideBase)
{
ElemHide.add(filter);
}
}
}
var hasEnabled = false;
for (var i = 0; i < filter.subscriptions.length; i++)
{
if (!filter.subscriptions[i].disabled)
{
hasEnabled = true;
}
}
if (!hasEnabled)
{
return;
}
if (filter instanceof RegExpFilter)
{
defaultMatcher.add(filter);
}
else if (filter instanceof ElemHideBase)
{
ElemHide.add(filter);
}
}
}
var hasEnabled = false;
for (var i = 0; i < filter.subscriptions.length; i++)
{
if (!filter.subscriptions[i].disabled)
{
hasEnabled = true;
}
}
if (!hasEnabled)
{
return;
}
if (filter instanceof RegExpFilter)
{
defaultMatcher.add(filter);
}
else if (filter instanceof ElemHideBase)
{
ElemHide.add(filter);
}
}