Closed
Bug 1215048
Opened 9 years ago
Closed 8 years ago
Provide a reliable way to register WebExtensions API in an arbitrary context
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: ecfbugzilla, Unassigned)
References
Details
(Whiteboard: triaged[intent-to-close])
As things are now, getting WebExtensions API into your extension requires something like the following:
let extension = new Extension(...);
extension.startup().then(function()
{
let context = new ExtensionPage(extension, {type: "background", contentWindow: global});
let chrome = Management.generateAPIs(extension, context);
...
}
Problem is: neither ExtensionPage nor Management are public API. Also, it's not obvious whether omitting docShell parameter (which is not available in many contexts) will have consequences. There really should be a simple and public shortcut to generate the APIs, for example:
let chrome = extension.generateAPIs(global);
Updated•9 years ago
|
Flags: blocking-webextensions-
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
I don't think I agree with the dupe here. native.js is intended to be for new APIs that could be used by a variety of add-ons. Perhaps we could use some of the same code to allow regular extensions to use WebExtension APIs. But I want to make sure that the concepts of "native.js extension" and "legacy extension with some WebExtension code attached" are kept pretty separate. So I could see the native.js prototype being a dependency here, but not a dupe.
Comment 3•9 years ago
|
||
Fair enough, as long as we're clear that this is about allowing traditional extensions to provide APIs for code running in that extension, and not about allowing them to provide APIs for other extensions.
Reporter | ||
Comment 4•9 years ago
|
||
Yes, this is about traditional extensions using APIs provided by WebExtensions - as a way to transition to WebExtensions gradually. Bug 1215035 has an explanation why this gradual transition is necessary.
Updated•9 years ago
|
Whiteboard: triaged
Comment 5•8 years ago
|
||
I think based on https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Embedded_WebExtensions, that we can now close this one.
Whiteboard: triaged → triaged[intent-to-close]
Reporter | ||
Updated•8 years ago
|
Status: REOPENED → RESOLVED
Closed: 9 years ago → 8 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•