Skip to content

Add support for Firefox-specific APIs #1652

Open
@XFox111

Description

@XFox111

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?

#1651

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions