Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/LinusU/wext-manifest

Web Extensions polyfill for the `manifest.json` API
https://github.com/LinusU/wext-manifest

Last synced: 3 months ago
JSON representation

Web Extensions polyfill for the `manifest.json` API

Awesome Lists containing this project

README

        

# Web Extensions polyfill: `manifest`

Web Extensions polyfill for the `manifest.json` API.

The goal with this package is to implmenet a subset of the Web Extensions API that works for Chrome, Firefox, Safari and Edge.

This module will take a definition input for the manifest, and return you filename and content for the specified browser.

## Installation

```sh
npm install --save @wext/manifest
```

## Usage

```js
const wextManifest = require('@wext/manifest')

const input = {
manifest_version: 2,
name: 'Example',
version: '1.0.0',

icons: {
16: 'Icon.png',
32: 'Icon-32.png',
64: 'Icon-64.png'
},

applications: {
gecko: { id: '{754FB1AD-CC3B-4856-B6A0-7786F8CA9D17}' },
safari: { id: 'com.example.extension' }
},

author: 'Linus Unnebäck',
description: 'Example extension',
homepage_url: 'http://example.com/',

permissions: [
'activeTab',
'http://example.com/*'
],

browser_action: {
default_title: 'Example',
default_popup: 'popup.html',
default_icon: {
16: 'Icon.png',
32: 'Icon-32.png',
64: 'Icon-64.png'
}
}
}

console.log(wextManifest.firefox(input))
// => { name: 'manifest.json', content: '{"manifest_version":2...' }

console.log(wextManifest.safari(input))
// => { name: 'Info.plist', content: '