Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/LinusU/wext-manifest
- Owner: LinusU
- Created: 2018-01-24T17:31:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T10:50:42.000Z (over 4 years ago)
- Last Synced: 2024-07-02T12:20:26.433Z (4 months ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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: '