NEW 245236
Content Blocking Rules `if-domain` mismatch when using URLScheme handler
https://bugs.webkit.org/show_bug.cgi?id=245236
Summary Content Blocking Rules `if-domain` mismatch when using URLScheme handler
Bartosz Waresiak
Reported 2022-09-15 12:09:28 PDT
Created attachment 462361 [details] Test cases demonstrating the issue Overview We are using URLScheme handler to test Content Blocking rule generation locally, without need for network connection. Since macOS 12 (and corresponding iOS release) we are running into an issue that some tests are consistently failing - Common point is ignore-previous-rules action with trigger that uses if-domain matching. Steps to Reproduce See attached file for a test case with an example: there are 4 combinations that should result in the same outcome: test page loading 3rd party resource through preconfigured scheme handler, but in one of the cases test fails (content blocker blocks the request). Details of configuration: Content blocking rules (made to block all traffic from otherhost.com but allow one certain resource on a certain website): [ { "action": { "type": "block" }, "trigger": { "url-filter": "testscheme://otherhost.com/.*" } }, { "action": { "type": "ignore-previous-rules" }, "trigger": { "url-filter": "testscheme://otherhost.com/img.png", "if-domain": [ "testhost.com" ] } } ] Static website embedding `<img src='testscheme://otherhost.com/img.png'>` resource. If main page is set to testscheme://testhost.com test blocks img request (unexpected). If main page is set to testscheme://testhost.com/index.html test allows img request (correct). If we remove `"if-domain"` from trigger, both above cases allow img request (expected). Build Date & Hardware Happens on macOS 12 and recent iOS releases. Tested on revision 833c22ec9c71.
Attachments
Test cases demonstrating the issue (4.23 KB, patch)
2022-09-15 12:09 PDT, Bartosz Waresiak
no flags
Radar WebKit Bug Importer
Comment 1 2022-09-22 12:10:19 PDT
Note You need to log in before you can comment on or make changes to this bug.