Promise wrapper for chrome api
npm install then-chrome


Promise-based chrome api.
``js
var thenChrome = require('then-chrome');
// get tabs list
thenChrome.tabs.query({currentWindow: true})
.then(console.log); // tabs list
// get all cookies by name
thenChrome.cookies.getAll({name: 'cookieName'})
.then(console.log); // cookie list
// detect language by tab
thenChrome.tabs.detectLanguage(10)
.then(console.log); // en
.catch(console.warn); // catch chrome.runtime.lastError value
`
Sync methods are wrapped too
`js
var thenChrome = require('then-chrome');
thenChrome.i18n.getMessage('title')
.then(console.log); // 'extension title'
`
There is native Promise inside then-chrome by default, but you can use every Thenable lib, compatible with Promises/A+ standart.
`js
var Q = require('q');
var BlueBird = require('bluebird');
var create = require('then-chrome/out/api');
var thenChromeQ = create(Q.Promise); // then-chrome with Q promise inside
var thenChromeBB = create(BlueBird); // then-chrome with bluebird promise inside
`
`bash`
npm install then-chrome
or
`bash`
git clone https://github.com/acvetkov/then-chrome.git
cd then-chrome
npm install
`bash`
npm run build
`bash``
npm test
1. chrome.alarms
2. chrome.bookmarks
3. chrome.browserAction
4. chrome.browsingData
5. chrome.commands
6. chrome.contextMenus
7. chrome.cookies
8. chrome.debugger
9. chrome.desktopCapture
10. chrome.devtools.inspectedWindow
11. chrome.devtools.network
12. chrome.devtools.panels
13. chrome.dial (undocumented API for communication with DIAL-capable devices)
13. chrome.downloads
14. chrome.extension
15. chrome.fontSettings
16. chrome.gcm
17. chrome.history
18. chrome.i18n
19. chrome.identity
20. chrome.idle
21. chrome.instanceID
22. chrome.management
23. chrome.notifications
24. chrome.omnibox
25. chrome.pageAction
26. chrome.pageCapture
27. chrome.permissions
28. chrome.privacy
28. chrome.proxy
29. chrome.runtime
30. chrome.sessions
31. chrome.storage
32. chrome.system.cpu
33. chrome.system.memory
34. chrome.system.storage
35. chrome.tabCapture
36. chrome.tabs
37. chrome.topSites
38. chrome.tts
39. chrome.webNavigation
40. chrome.webRequest
41. chrome.windows