HowTo: Executescript to return the number of tabs that are open

Is it possible to use executescript to return the number of tabs are open an which tab index the current tab is?

Why would you need this? (Depending on the reason, there are some methods to get it)

Yes! You can directly use these internal variables, no need to use ExecuteScript.

  • Absolute Tab Index (most leftmost tab = 0): ${!current_tab_number}
  • Relative Tab Index (macro starting tab = 0): ${!current_tab_number_relative}