Promise-based chrome api.
var chromeApi = require('then-chrome');
// get tabs list
chromeApi.tabs.query({currentWindow: true})
.then(console.log); // tabs list
// get all cookies by name
chromeApi.cookies.getAll({name: 'cookieName'})
.then(console.log); // cookie list
// detect language by tab
chromeApi.tabs.detectLanguage(10)
.then(console.log); // en
.catch(console.warn); // catch chrome.runtime.lastError value
Sycn methods are wrapped too
var chromeApi = require('then-chrome');
chromeApi.i18n.getMessage('title')
.then(console.log); // 'extension title'
npm install then-chrome
or
git clone https://github.com/acvetkov/then-chrome.git
cd then-chrome
npm install
npm run build
npm test