How to get tab count in Chrome desktop without app/extension?
(Note: This answer was provided using Chrome version 45)
By navigating to chrome://inspect/#pages
, one can view a list of all open pages (tabs):
Each entry includes a link below it with the text "inspect". By performing a Find operation on the page (ctrl/cmd + F) for the string inspect
, Chrome will produce the Find input box containing the total number of instances of the searched string, and, in this case, the total number of open pages/tabs in your browser!
While jsejcksn's answer led me in the right direction, it wasn't enough, since (on Chrome version 67) this page also contains embedded windows in pages, so the total count of inspect
search results can be greater than the actual tab count.
The solution I found is the following:
- Go to
chrome://inspect/#pages
Run the following line of code in the javascript console:
document.getElementById("pages-list").childElementCount
The tabs count will be printed to the console.