EFForg / EFForg/SafariWebExtensionBugs
DNR: trailing separator `^` in `urlFilter` fails to match end of URLs
- Dominant language
- No language data
- Stars
- 6
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
DNR rules with a urlFilter ending in `^` fail to match requests as expected. The `^` separator is not being respected as an end-of-URL boundary anchor.
**Expected behavior:**
According to DNR documentation from [Chrome](https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest#property-RuleCondition-urlFilter) and [Mozilla](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/RuleCondition#urlfilter), the `^` separator character in urlFilter should match the end of the URL.
**Actual behavior:**
A DNR rule with urlFilter `||example.com/track^` does not match a request to `www.example.com/track`.
**Impact:**
Safari should implement the same behavior for urlFilter patterns as Chrome and Firefox, or document this difference. Although workarounds exist, cross-browser extension maintenance would be significantly easier if urlFilter patterns were consistent across browsers.
**Steps to reproduce:**
This is an issue in Safari 26.1 and Safari Tech Preview 232.
1. Add the following DNR rule to a test extension:
```
{
"id": 3,
"priority": 1,
"action": {
"type": "block"
},
"condition": {
"urlFilter": "||platform.twitter.com/widgets.js^",
"domainType": "thirdParty"
}
}
```
2. Visit https://fmarier.github.io/brave-testing/social-widgets.html
3. Check the Network tab for a request to https://platform.twitter.com/widgets.js. The request is NOT blocked in Safari as it is in other browsers with the same DNR rule.
4. Update the DNR rule to remove the ^ at the end of urlFilter
5. Re-visit https://fmarier.github.io/brave-testing/social-widgets.html and confirm the request to https://platform.twitter.com/widgets.js is now blocked
**Apple Feedback Assistant Report**: https://feedbackassistant.apple.com/feedback/21161264
Contributor guide
No contributing guide indexed for this repository
Research direction
No repository files or tests are named. Start by reproducing the rule in Safari 26.1 or Safari Technology Preview 232, compare it with Chrome and Firefox behavior and the linked DNR documentation, then determine whether Safari fixes the `^` boundary behavior or documents the difference.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100