Closed Bug 1359229 Opened 7 years ago Closed 4 years ago

Make clear if an API is available from content scripts or not

Categories

(Developer Documentation Graveyard :: Add-ons, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: fabrice, Unassigned)

Details

The list of APIs usable from content scripts is documented at https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#WebExtension_APIs, but when just looking for a given API this information is lost.

For instance, https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs only talks about required permissions, but not about the restriction to background pages.

Ideally we would have more documentation bits (could be some kind of badge) alongside each extension api.
I'm not sure about this. Almost all (at least 90% of) WebExtension APIs are unavailable in content scripts. So I think noting, next to each API, whether it is available has a pretty poor signal to noise ratio.

It's better, I think, just to assume (and document) that the APIs are not available, with a few exceptions (primarily messaging, i18n, and storage). Everyone working with content scripts is going to have to read https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts at some point, and as you say, the supported APIs are listed there.
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.