Consider supporting mapping to AsyncAmbiguous through GenerateWebIDLBindings.py config file
Categories
(WebExtensions :: General, task, P3)
Tracking
(firefox104 fixed)
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: rpl, Assigned: rpl)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(1 file, 1 obsolete file)
While working on the WebIDL bindings for the scripting
WebExtensions API (Bug 1748315) we noticed that the type signatures currently being generated by the GenerateWebIDLBindings.py script based on the scripting API JSONSchema definitions for the methods getRegisteredContentScripts
and unregisterContentScripts
are not all distinguishable from a WebIDL perspective.
As an example for the getRegisteredContentScript
we would be generating 2 methods with the following parameters:
[Throws, WebExtensionStub="Async"]
any getRegisteredContentScripts(any filter, optional Function callback);
[Throws, WebExtensionStub="Async"]
any getRegisteredContentScripts(optional Function callback);
which are not distinguishable when getRegisteredContentScript
is called with a single parameter (e.g. with only one undefined
value passed as call parameters, both the type signatures would match).
As a short term solution, we are considering to use a single method with the "AsyncAmbiguous" WebExtensionStub (which we already support and currently use for browser.runtime.sendMessage
):
[Throws, WebExtensionStub="AsyncAmbiguous"]
any getRegisteredContentScripts(any... args);
The CallWebExtMethodAsyncAmbiguous
stub does take care internally of removing the optional chrome-compatible callback parameter before serializing and forwarding the rest of the parameters to the ExtensionAPIRequestHandler defined on the main thread, and so it would technically be the same as if a webidl method defined as any getRegisteredContentScripts(any filter, optional Function callback)
.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D142682
Comment 3•2 years ago
|
||
Comment on attachment 9270421 [details]
Bug 1762592 - Remove unnecessary trailing whitespace from extension API generated webidl filed.
Revision D142683 was moved to bug 1779561. Setting attachment 9270421 [details] to obsolete.
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/cf8d44dbecdc Support mapping to AsyncAmbiguous through GenerateWebIDLBindings.py config file. r=willdurand
Comment 5•2 years ago
|
||
bugherder |
Description
•