chrome-call
Call the Chrome JavasScript APIs then return a Promise.
Install
Use with webpack
If you build your project with webpack, then you can install chrome-call from npm:
npm install chrome-call
then you can import it in your project:
// es6 // commonjsconst chromeCall =
Use with <script>
Download chrome-call.js from unpkg(min version), then reference it in your html:
<!-- now you will get a global variable named chromeCall -->
Usage
When you do:
const promise = { chrometabs}
It's equal to:
const promise =
That's really simple, right?
Multiple arguments in callback
Most of chrome API only has zero or one argument in callback, but someone not, such as chrome.hid.receive.
In this situation, pass true
as the first argument, then the value of promise will be an real Array:
License
MIT