Index: lib/abp2blocklist.js |
diff --git a/lib/abp2blocklist.js b/lib/abp2blocklist.js |
index e9bbd1c00ef7826b4b6b0ad48ed12d7889c8a527..50fd122cd08b5804870e1c34dab6e95f72712407 100644 |
--- a/lib/abp2blocklist.js |
+++ b/lib/abp2blocklist.js |
@@ -276,6 +276,17 @@ function convertFilterAddRules(rules, filter, action, withResourceTypes) |
{ |
trigger["resource-type"] = getResourceTypes(filter); |
+ // Content Blocking rules can't differentiate between sub-document |
+ // requests (iframes) and top-level document requests (redirects). So to |
+ // avoid too many false-positives we stop generic rules (no hostname part) |
+ // from blocking document requests. |
+ if (action == "block" && !parsed.hostname) |
+ { |
+ let documentIndex = trigger["resource-type"].indexOf("document"); |
+ if (documentIndex > -1) |
+ trigger["resource-type"].splice(documentIndex, 1); |
+ } |
+ |
if (trigger["resource-type"].length == 0) |
return; |
} |