Closed Bug 1909474 Opened 3 months ago Closed 2 months ago

webRequest.getSecurityInfo() options parameter is documented as optional but cannot be optional

Categories

(WebExtensions :: Request Handling, defect, P3)

defect

Tracking

(firefox130 fixed)

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

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

Attachments

(1 file)

options parameter documented as optional: https://searchfox.org/mozilla-central/rev/de46cd99a7d1634058b511a3f546a970763e5048/toolkit/components/extensions/schemas/web_request.json#469,479-480

Implementation has (requestId, options = {}):

options = {} only converts an omitted options to {} if options is undefined. But the Schema validator converts missing options to null instead, which prevents this from working.

Consequently, a call to browser.webRequest.getSecurityInfo(requestId) without options parameter results in an (async) error.

Severity: -- → S4
Keywords: dev-doc-needed
Priority: -- → P3
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/8f712579adcb Treat options in getSecurityInfo as optional r=rpl
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

Could I clarify what documentation is required here? We already document this as optional e.g. "object. An object which may contain any of the following properties, all optional:" Or is the requirement a release note to state that this now behaviors as documented?

Flags: needinfo?(rob)

The options object itself should also be marked as optional on MDN ({{optional_inline}}), at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/getSecurityInfo#options

The BCD should mention that the option is optional since 130.

Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: