Get the number of open tabs in Chrome

Hi @bcm,

  1. Every Chrome and Edge instance has an inspect webpage. Both of these show the current sessions and tabs open in different windows of the browser.

    • "chrome://inspect/#pages"
    • "edge://inspect/#pages"
  2. Within this page we can query a javascript code in the Browser's console. This will give us the number of Tabs open in N number of windows in Chrome or Edge.

  3. Finally, we get the value of the query result and subtract 1 from it. We do this to ensure that we do not calculate the session we opened ourselves to check for number of tabs.

    • (Cint(Value)-1).ToString+" tabs are open in the Chrome browser."

Here is a workflow for Chrome browser:
ChromeTabs.xaml (22.1 KB)

The selectors will differ for Edge (Chromium) browser, but the above approach will work there too.

1 Like