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)

defect
Not set
normal

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);
Flags: blocking-webextensions-
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.
Status: RESOLVED → REOPENED
Depends on: 1199718
Resolution: DUPLICATE → ---
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.
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.
Whiteboard: triaged
Blocks: 1252272
Whiteboard: triaged → triaged[intent-to-close]
Status: REOPENED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → WONTFIX
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.