Ask a Question

How to get total number of tab in Firefox

qanhd
Occasional Contributor

How to get total number of tab in Firefox

Hello,



Can you please show me how to get the total number of tab(s) in Firefox, for one and multiple firefox process opening?  I would prefer not to use Page index since url can be different at times.



I am using firefox 3.5.6, TC 7.51.667.7



Thanks in advance.
1 REPLY 1

RE: How to get total number of tab in Firefox

Hi Anh,


You can use the following code:


[JScript]


function sample()

{

  var firefoxProcesses = VBArray(Sys.FindAllChildren("ProcessName", "firefox")).toArray();

  Log.Message("There are " + firefoxProcesses.length + " Firefox processes running in the system.");

  for (var i = 0; i < firefoxProcesses.length; i++)

  {

    var pagesCount = VBArray(firefoxProcesses.FindAllChildren("Name", "Page*")).toArray().length;

    Log.Message("Process #" + i + " has " + pagesCount + " pages opened.");

  }

}



Best regards,
Alexey

Join Wintertainment 2021 to share your stories, have fun, earn community badges, and more!
cancel
Showing results for 
Search instead for 
Did you mean: