npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

then-chrome

v1.0.7

Published

Promise wrapper for chrome api

Downloads

79

Readme

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.dial (undocumented API for communication with DIAL-capable devices)
  14. chrome.downloads
  15. chrome.extension
  16. chrome.fontSettings
  17. chrome.gcm
  18. chrome.history
  19. chrome.i18n
  20. chrome.identity
  21. chrome.idle
  22. chrome.instanceID
  23. chrome.management
  24. chrome.notifications
  25. chrome.omnibox
  26. chrome.pageAction
  27. chrome.pageCapture
  28. chrome.permissions
  29. chrome.privacy
  30. chrome.proxy
  31. chrome.runtime
  32. chrome.sessions
  33. chrome.storage
  34. chrome.system.cpu
  35. chrome.system.memory
  36. chrome.system.storage
  37. chrome.tabCapture
  38. chrome.tabs
  39. chrome.topSites
  40. chrome.tts
  41. chrome.webNavigation
  42. chrome.webRequest
  43. chrome.windows

Useful resources

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