1.0.3 • Published 8 years ago

promiseproxy-chrome v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

view on npm

Promisified Chrome API

PromiseProxy with a schema for the Chrome JavaScript APIs.

Requirements

  • Node.js 6+, Chrome or other ES2015 Proxy object supporting environment

Installation

npm install promiseproxy-chrome

Usage

// Promisify the global chrome object
const _chrome = require('promiseproxy-chrome')(chrome)
// Callback methods return promises when the callback parameter is null or undefined
_chrome.tabs.query(info).then(callback)

Build

npm run build

Updating api.json

Use in console on each page of the Chrome API docs:

localStorage.methods = JSON.stringify(Object.assign(JSON.parse(localStorage.methods), { [location.pathname]: $$('#toc .pln').filter(x => /callback/i.test(x.textContent)).map(x => x.closest('.prettyprint').textContent) }))

Copy contents of localStorage.methods to api.json.

Test

npm install --only=dev
npm run test

License

MIT

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago