Index: lib/filterListener.js |
=================================================================== |
--- a/lib/filterListener.js |
+++ b/lib/filterListener.js |
@@ -137,20 +137,18 @@ |
*/ |
function addFilter(filter) |
{ |
if (!(filter instanceof ActiveFilter) || filter.disabled) |
return; |
let hasEnabled = false; |
let allowSnippets = false; |
- for (let i = 0; i < filter.subscriptions.length; i++) |
+ for (let subscription of filter.subscriptions) |
{ |
- let subscription = filter.subscriptions[i]; |
- |
if (!subscription.disabled) |
{ |
hasEnabled = true; |
// Allow snippets to be executed only by the circumvention lists or the |
// user's own filters. |
if (subscription.type == "circumvention" || |
subscription instanceof SpecialSubscription) |
@@ -184,19 +182,19 @@ |
function removeFilter(filter) |
{ |
if (!(filter instanceof ActiveFilter)) |
return; |
if (!filter.disabled) |
{ |
let hasEnabled = false; |
- for (let i = 0; i < filter.subscriptions.length; i++) |
+ for (let subscription of filter.subscriptions) |
{ |
- if (!filter.subscriptions[i].disabled) |
+ if (!subscription.disabled) |
{ |
hasEnabled = true; |
break; |
} |
} |
if (hasEnabled) |
return; |
} |