cross-browser-extension-manager

1.0.2 • Public • Published

cross-browser-extension-manager

A module for writing cross-browser extensions

Most browsers (other than Safari) have implemented the WebExtensions API for writing browser extensions.

Unfortunately, they've often hidden that common API under a variety of differently named global objects.

When you import cross-browser-extension-manager, it grabs those WebExtension APIs from wherever they're hiding, and hangs them all on a singleton object that it returns to you.

Just use cross-browser-extension-manager instead of the browser specific extension prefixing.

Sample Usage

First install with yarn install cross-browser-extension-manager.

const extension = require("cross-browser-extension-manager");

// Ever notice you can't use normal hyperlinks in an extension?
// Now it's easy:
extension.tabs.create({ url: "mailto:help@usman.io?subject=Feedback" });

const manifest = extension.runtime.getManifest();

For the full list of supported methods, refer to the MDN API documentation.

Running Tests

Run yarn test after running yarn.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i cross-browser-extension-manager

    Weekly Downloads

    1

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    6.85 kB

    Total Files

    10

    Last publish

    Collaborators

    • usmanramay