Skip to content

Support for browser.* APIs #276

@devkabiir

Description

@devkabiir

Hi there!,
Would it be possible to create webextensions using this lib?

The chrome.* and browser.* APIs are the same(at least that's what I think) and there are polyfills available in JS echo-system to create cross-browser webextensions.

After looking through the source I found that in lib/src/common.dart

final JsObject chrome = context['chrome'];

I don't know a whole lot about extension development and dart in general, still learning.
But my understanding is this that if chrome is assigned to context['chrome'] ?? context['browser'] then extensions should also work in firefox.

For instance in MDN docs for browser.tabs.getCurrent in acknowledgements section it is said that
browser.tabs is based on chrome.tabs API. So the above change should allow all the chrome.* based APIs in firefox to work when using this lib.

I don't know if this is even in the scope of this lib, looking for some guidance on how to develop cross-browser extensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions