Chrome on Linux - query the browser to see what tabs are open? Chrome on Linux - query the browser to see what tabs are open? google-chrome google-chrome

Chrome on Linux - query the browser to see what tabs are open?


Chrome on Linux - query the browser to see what tabs are open?

For chromium :

strings ~/'.config/chromium/Default/Current Session' | 'grep' -E '^https?://'


Indeed there is a command line option which can open the door to a running chrome (chromium) process --remote-shell-port. Through this "debugging back-door" you may be able the get the list of open tabs.

UPDATE:

Chrome DevTools is deprecated and not supported anymore since Version >17.0.950.* See WebKit-Protocol manual if the new Debug-Framework provides similar manners to accomplish the task.


Here is a more general solution (works with other applications as well) by querying the X window under focus using xdotool

while true; do   xdotool getwindowfocus getwindowname;   sleep 10; done

This outputs the following for instance:

Tilix: Defaultpeter-ThinkPad-T5801: peter@peter-ThinkPad-T580: ~Chrome on Linux - query the browser to see what tabs are open? - Stack Overflow - Google ChromeLocal KVMuntitled — Atomuntitled — AtomOpen Fileiostat_xtmz_3.out — ~/Work/KappAhl/Test1 — AtomTilix: Defaultpeter-ThinkPad-T5801: peter@peter-ThinkPad-T580: ~*