Closed Bug 1745759 Opened 2 years ago Closed 1 year ago

[DNR] Prototype of urlFilter condition

Categories

(WebExtensions :: Request Handling, enhancement, P1)

enhancement
Points:
3

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [mv3-m2])

Attachments

(2 files, 1 obsolete file)

Implement the matcher for URLs using the DNR urlFilter syntax as described at https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/##property-RuleCondition-urlFilter

Blocks: 1745768
Points: --- → 5
Blocks: 1782685
Points: 5 → 3

In the patch to this bug, I included unit tests that I imported from Chrome, to verify that we have parity on the implementation of urlFilter.

Chrome's tests at https://chromium.googlesource.com/chromium/src.git/+/refs/tags/110.0.5442.0/components/url_pattern_index/url_pattern_unittest.cc do not directly test the urlFilter string, but a parsed internal representation. There are two notable tests, an empty pattern + kSubdomain+kAnchorNone and kBoundary+kBoundary. Both of these are serialized as "||". In practice, "||" is interpreted as a subdomain anchor, not as Left anchor + Right anchor.

The implementation that I am attaching to this bug passes all tests (imported ones + new ones).

Update to https://bugzilla.mozilla.org/show_bug.cgi?id=1745759#c1 : include the original URLPattern constructor details in a comment to make it easier to compare the converted/imported test with the original source.

Attachment #9305833 - Attachment is obsolete: true
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/055fc5e09a3e
Implement DNR urlFilter condition r=rpl
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: