Open Bug 1762591 Opened 2 years ago Updated 1 year ago

Consider generating WebIDL dictionaries for WebExtensions API types used in API methods

Categories

(WebExtensions :: General, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: rpl, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [addons-jira])

The goal of this bug is to consider improving the GenerateWebIDLBinding.py python script to make it able to generate the WebIDL dictionaries for the API types of type object and replace more generic types (like any, or object) with more specific WebIDL dictionary types, along with considering other possible improvements to be able to move on the worker thread as much of the parameters validation as possible.


The GenerateWebIDLBinding.py python script we use to generate WebIDL definitions from the WebExtensions API JSONSchema does not currently generate WebIDL dictionaries definitions for the types defined in the JSONSchema.

The parameters are still validated and normalized using the JSONSchema data once the API call request is forwarded from the worker thread to the main thread, which means that:

  • if the extension pass a non-"structured cloneable" parameter by mistake while the WebIDL method expects it to be serializable, we would be currently raising a "An unexpected error occurred" (while the current bindings provided on the main thread would likely be throwing a more specific parameter validation error message)

  • if the extension pass a "structured cloneable" parameter but missing some required property, we would need to hit the main thread before being able to throw the expected parameter validation error

See Also: → 1762592
Duplicate of this bug: 1779561
Blocks: 1779555
You need to log in before you can comment on or make changes to this bug.