#### Steps to reproduce 1. Register a content blocker with the following content: ``` [ { "trigger": { "url-filter": ".*" }, "action": { "type": "css-display-none", "selector": "img" } }, { "trigger": { "url-filter": "^https?://([^/]*\\.)?yahoo\\.com[/:&?]?", "resource-type": [ "document" ] }, "action": { "type": "ignore-previous-rules" } } ] ``` 2. Open yahoo.com #### Expected result All images are visible #### Actual result All images are hidden #### Explanation According to the [WebKit code](https://trac.webkit.org/browser/trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp#L76), `universalWithDomains` and `universalWithoutDomains` rules have higher priority. So, despite that the problematic rule precedes exception rule, it is not ignored.
<rdar://problem/30240549>
I think what is happening in this case is the main resource is being loaded and the main resource is correctly ignoring previous rules and not applying the css-display-none rule. Any sub resource that is loaded that is not a document from yahoo.com would then trigger the first rule but not the ignore-previous-rules, thus hiding the images. This behaves correctly.
> Any sub resource that is loaded that is not a document from yahoo.com would then trigger the first rule but not the ignore-previous-rules, thus hiding the images. I don't get it, how is that possible that "css-display-none" rule is applied to a non-document? I mean aren't stylesheets supposed to work in the context of a document only? Moreover, if I replace "url-filter": ".*" with "url-filter": "^http.*", content blocker starts working properly (all images are visible): ``` [ { "trigger": { "url-filter": "^http.*", }, "action": { "type": "css-display-none", "selector": "img" } }, { "trigger": { "url-filter": "^https?://([^/]*\\.)?yahoo\\.com[/:&?]?", "resource-type": [ "document" ] }, "action": { "type": "ignore-previous-rules" } } ] ```
Your example in comment 3 doesn't hide images because it is invalid JSON and fails to compile. If you remove the , at the end of "^http.*", then it will successfully compile and behave correctly by hiding images because the triggers fire on sub resource loads. This is how the feature works. It behaves correctly.
I've definitely run into this issue. Consider this rule set: [ { "trigger": { "url-filter": "^https?://" }, "action": { "type": "css-display-none", "selector": ".sponsored-container-bottom" } }, { "trigger": { "url-filter": "^https?://([^/]+\\.)?walmart\\.com" }, "action": { "type": "ignore-previous-rules" } } ] The first rule should hide any element with the class "sponsored-container-bottom" on any URL beginning with http:// or https:// The second rule, which only applies to walmart.com and subdomains, should disable the first rule. You can try this out on the following URL: https://www.walmart.com/search/?query=car%20rental%20cologne It does not work. Here's the Adblock Plus issue for more details: https://issues.adblockplus.org/ticket/5345 Am I misunderstanding how ignore-previous-rules is supposed to work?