extensionizer

1.0.1 • Public • Published

Extensionizer

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 extensionizer, 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 extensionizer instead of the browser specific extension prefixing.

Sample Usage

First install with npm install extensionizer -S.

const extension = require('extensionizer')
 
// Ever notice you can't use normal hyperlinks in an extension?
// Now it's easy:
extension.tabs.create({url: 'mailto:help@metamask.io?subject=Feedback'})
 
const manifest = extension.runtime.getManifest()

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

Running Tests

Install Mocha (npm install -g mocha).

Run npm test.

/extensionizer/

    Package Sidebar

    Install

    npm i extensionizer

    Weekly Downloads

    185

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    5.62 kB

    Total Files

    6

    Last publish

    Collaborators

    • mcmire
    • nicholasellul
    • lgbot
    • naugtur
    • ritave
    • danfinlay
    • kumavis
    • rekmarks
    • metamaskbot
    • gudahtt
    • brad.decker
    • sethkfman