Open
Description
Feature Request
Add types for browser-specific APIs and make them separate. For example:
// This API is cross-browser compatible, so it can be accessed via `browser`
await browser.tabs.create({ url: "https://github.com" });
// This is Chrome-specific API, which is not accessible on Firefox
await chrome.sidePanel.open({ windowId: 123 });
// This is Firefox-specific API, which is not accessible on Chrome
await firefox.sidebarAction.open();
Right now, since 0.20.0, browser
implements only Chrome API types, which makes Firefox-specific API harder to access.
Ideally, if possible, it would be also a good idea to setup some linting for that, in case an extension tries to access browser-specific API without first checking which browser it is currently running on.
Is your feature request related to a bug?
What are the alternatives?
Bring back webextension-polyfill
. That way we can use browser
for cross-compatible/Firefox-specific APIs, and chrome
for Chrome-specific ones.
Additional context
Chrome and Firefox have quite a big set of incompatible APIs, and it would be nice to have access to them as well
Metadata
Metadata
Assignees
Labels
No labels