Exposing developer tools contexts in runtime.getContexts() API #670
Labels
supportive: chrome
Supportive from Chrome
supportive: firefox
Supportive from Firefox
supportive: safari
Supportive from Safari
Exposing developer tools contexts in runtime.getContexts() API
WECG proposal for
runtime.getContexts()
https://github.com/w3c/webextensions/blob/main/proposals/runtime_get_contexts.md
Background
Extensions can customize the browser developer tools. When an extension customises the developer tools, it can run code in the following contexts:
devtools.panels.create()
from the developer tools page (1).devtools.panels.<panel>.createSidebarPane()
from the developer tools page (1).Proposal
All the above contexts host extension content (HTML and JavaScript). These should be available in the results of
runtime.getContexts()
API.runtime.getContexts()
asynchronously returns a list ofExtensionContext
objects. Following is a description of howExtensionContext
’s fields would be populated for developer tools contexts.DEVTOOLS_PAGE
for developer tools page.DEVTOOLS_PANEL
for developer tools panel.DEVTOOLS_SIDEBAR_PANE
for developer tools sidebar pane.Other fields (contextId, documentId, frameId, documentUrl, documentOrigin, incognito) should be populated as expected. No special handling is needed for them.
Current support
Compatibility issues
Chrome already returns developer tools contexts via the API; some extensions might be using that information. Currently the contexts are returned with the “TAB” context type and that is a bug.
Creating this issue to get group's feedback. We will create a follow-up PR to modify the
runtime.getContexts()
proposal after we have consensus within the group.The text was updated successfully, but these errors were encountered: