Skip to content

Instantly share code, notes, and snippets.

@rxw1
Forked from jlewin/countTabs.js
Last active December 30, 2015 07:49
Show Gist options
  • Save rxw1/7799022 to your computer and use it in GitHub Desktop.
Save rxw1/7799022 to your computer and use it in GitHub Desktop.
Count open tabs in Google Chrome.
chrome.windows.getAll({populate: true}, function(a) {
var n=0;
for (var x in a) {
n+=a[x].tabs.length;
}
console.log(n);
});
// => undefined (?)
// => 154 :D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment