NEW297838
dNR: fails to match separator `^` to end of URL in `urlFilter`
https://bugs.webkit.org/show_bug.cgi?id=297838
Summary dNR: fails to match separator `^` to end of URL in `urlFilter`
rhill
Reported 2025-08-24 06:00:53 PDT
The official DNR documentation[1] (my emphasis): > '^' : Separator character: This matches anything except a letter, a digit, or one of the following: _, -, ., or %. **This also match the end of the URL.** For instance the following filter should visually break the web site `https://arstechnica.com/`: { "action": { "type": "block" }, "condition": { "resourceTypes": [ "stylesheet" ], "urlFilter": "arstechnica.net/wp-content/themes/*.css^" }, "id": 5 } However the stylesheets are not blocked as expected, the following network request is not blocked by the above rule: https://cdn.arstechnica.net/wp-content/themes/ars-v9/public/css/app.6e4698.css The source code comment[2] appears to support that the conversion process does not take into account that `^` should also match end of URL: > // '^' : Separator character: This matches anything except a letter, a digit or one of the following: _ - . %. Note: the above issue can be easily reproduce in the extension uBlock Origin Lite, in which it is possible to directly enter DNR rules after enabling "Develop" option in its dashboard, which will make available a "Custom DNR rules" editor in which the above rule can be copy/pasted. --- [1] https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest#type-RuleCondition [2] https://github.com/WebKit/WebKit/blob/c9ff2b60570e45499e67a9cf5d72a7b567850a1f/Source/WebKit/UIProcess/Extensions/Cocoa/_WKWebExtensionDeclarativeNetRequestRule.mm#L1166
Attachments
Radar WebKit Bug Importer
Comment 1 2025-08-24 06:01:24 PDT
Simeon Vincent
Comment 2 2025-12-17 18:23:49 PST
I'm interested in working on this issue. I am currently setting up my local development environment for WebKit.
Simeon Vincent
Comment 3 2026-01-15 13:13:51 PST
Note You need to log in before you can comment on or make changes to this bug.