Closed Bug 1886608 Opened 6 months ago Closed 4 months ago

[DNR] Accept rules with unrecognized keys

Categories

(WebExtensions :: Request Handling, enhancement, P2)

enhancement

Tracking

(firefox128 fixed)

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: robwu, Assigned: willdurand)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [wecg][addons-jira])

Attachments

(1 file)

Firefox currently ignores static DNR rules when there are unrecognized properties in the file.

Chrome and Safari ignore these keys, and apply rules that are valid otherwise. In the WECG we reached consensus on ignoring unrecognized keys, so we should implement that. The relevant discussion is tracked at https://github.com/w3c/webextensions/issues/466

One would be inclined to consider adding "additionalProperties": { "$ref": "UnrecognizedProperty" }, to the various rule object definitions in declarative_net_request.json. The issue with that naive implementation is that updateDynamicRules / updateSessionRules would then not throw when a rule is invalid, which would impede feature detection. So we should have manifest-specific behavior.

Fixing bug 1831417 could be an easy way to support this (along with fixing up failing unit tests).

Severity: -- → N/A
Priority: -- → P2
Assignee: nobody → wdurand
Status: NEW → ASSIGNED
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/32c5cc8e8dce Accept DNR rules with unrecognized keys. r=robwu
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
Keywords: dev-doc-needed

Change are ready for review: Static DNR rules with unrecognized keys loaded #34522

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: