Skip to content

Proposal: Perform additional normalization on input URLs to the declarativeNetRequest API #770

@oliverdunk

Description

@oliverdunk

In Chrome's implementation of declarativeNetRequest, when matching a URL pattern, we use the GURL form of an input URL to check against the underlying URL Pattern Index. The GURL library performs some standardized canonicalization on the raw URL string such as lowercasing the hostname and percent-encoding/decoding certain characters.

We’re considering doing additional normalization on input URLs before checking the index to make it simpler for rulesets to cover variations that should almost always serve the same content - namely decoding all characters except those that would be re-encoded by GURL (such as spaces) and removing trailing dots in fully-qualified domain names.

For example:

https://example.com./abc/8971e618a80dbb21327ae893560a085f.js
https://example.com/abc%2f8971e618a80dbb21327ae893560a085f.js

Would map to:

https://example.com/abc/8971e618a80dbb21327ae893560a085f.js

We would like to propose performing the above operations on all input URLs before matching against a URL pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage: safariSafari needs to assess this issue for the first timesupportive: chromeSupportive from Chrometopic: dnrRelated to declarativeNetRequest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions