Implement initial MV3 userScripts API bindings
Categories
(WebExtensions :: General, enhancement, P1)
Tracking
(firefox134 fixed)
Tracking | Status | |
---|---|---|
firefox134 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(4 files)
See https://bugzilla.mozilla.org/show_bug.cgi?id=1875475#c3 for details.
In-scope:
- userScripts.register, userScripts.unregister, userScripts.getScripts()
- MAIN world only.
- with persistency. Depends on skv (bug 1909409), but if that is not ready yet we can land with rkv at first and before enabling userScripts by default, switch to skv.
Updated•6 months ago
|
Assignee | ||
Comment 1•4 months ago
|
||
-
Add "userScripts" permission for MV3.
-
Add "userScripts" namespace for MV3, and add schema and logic to make
sure that this namespace is limited to MV3 only. -
Add tests to verify that the "userScripts" namespace of MV2 and MV3
are completely isolated. -
The functionality in this patch is limited to verifying that the API
bindings and permission requirement works; the rest of the
implementation will follow in the next patches.
Assignee | ||
Comment 2•4 months ago
|
||
Assignee | ||
Comment 3•4 months ago
|
||
Updated•4 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Assignee | ||
Comment 4•3 months ago
|
||
Although the bindings generator skips MV2-only APIs at some point
(https://searchfox.org/mozilla-central/rev/1bc0601cc5b3d4c3919d220acbe248221ebce035/toolkit/components/extensions/webidl-api/GenerateWebIDLBindings.py#337-338),
that only happens after loading all schemas. Because user_scripts.json
contains multiple userScripts.register definitions (one for MV2 and one
for MV3), GenerateWebIDLBindings.py raised the following error before
this patch:
TypeError: Unxpected multiple schema data for API property "userScripts.register" in schema group toolkit
This patch fixes the issue by ignoring the schemas that define the
userScripts API, and now the following test passes again:
./mach test toolkit/components/extensions/webidl-api/test/test_all_schemas_smoketest.py
Comment 6•2 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2056c51701e1
https://hg.mozilla.org/mozilla-central/rev/ea3cd3ed29f4
https://hg.mozilla.org/mozilla-central/rev/ee0e151f3179
https://hg.mozilla.org/mozilla-central/rev/5cc04d582843
Description
•