Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

then-chrome

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

then-chrome

Promise wrapper for chrome api

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

then-chrome

Build Status Coverage Status npm version

Promise-based chrome api.

usage

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

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.

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

install

npm install then-chrome

or

git clone https://github.com/acvetkov/then-chrome.git
cd then-chrome
npm install

build

npm run build

test

npm test

Supported methods

  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.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
  29. chrome.proxy
  30. chrome.runtime
  31. chrome.sessions
  32. chrome.storage
  33. chrome.system.cpu
  34. chrome.system.memory
  35. chrome.system.storage
  36. chrome.tabCapture
  37. chrome.tabs
  38. chrome.topSites
  39. chrome.tts
  40. chrome.webNavigation
  41. chrome.webRequest
  42. chrome.windows

Useful resources

Awesome Browser Extensions And Apps - a curated list of awesome resources for building browser extensions and apps.

Keywords

FAQs

Package last updated on 23 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc