Page 1 of 1

How to count the number of open Firefox browser tabs?

Posted: 13 Nov 2013, 15:04
by Coldblackice
This might be a longshot, but would it be possible for AHK to count the number of Firefox browser tabs currently open?

Re: How to count the number of open Firefox browser tabs?

Posted: 13 Nov 2013, 15:42
by Guest
You could cycle through the windows/tabs and count. Probably fails when you have two tabs on the same page - here is some code you might be able to use:
http://www.autohotkey.com/board/topic/1 ... t-re-find/

Alternatively you might try with Mozrepl (=FF addon + google the AHK library for it) and some javascript http://www.benjiegillam.com/2008/09/eve ... have-open/

Re: How to count the number of open Firefox browser tabs?

Posted: 13 Nov 2013, 17:46
by Coldblackice
Guest wrote:You could cycle through the windows/tabs and count. Probably fails when you have two tabs on the same page - here is some code you might be able to use:
http://www.autohotkey.com/board/topic/1 ... t-re-find/

Alternatively you might try with Mozrepl (=FF addon + google the AHK library for it) and some javascript http://www.benjiegillam.com/2008/09/eve ... have-open/
Thanks, much obliged for that.

I'm going to check up on the Mozrepl when I get home from work tonight, but do you think it might be possible to do this on an "OS" level, so to speak -- whether through some third party Firefox API, or perhaps "peeking" into Firefox's memory (rather than having to manually paginate through hundreds of tabs every time a count is done)?

Re: How to count the number of open Firefox browser tabs?

Posted: 14 Nov 2013, 00:44
by jethrow

Code: Select all

list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
MsgBox % list.accChildCount-1
for posterity, this could be done more effectively using UIA.

Re: How to count the number of open Firefox browser tabs?

Posted: 15 Nov 2013, 05:04
by Guest10
wow! this is totally unbelievable! :ugeek: can you also create a list of each open tab "title"? :ugeek:
jethrow wrote:

Code: Select all

list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
MsgBox % list.accChildCount-1
for posterity, this could be done more effectively using UIA.

Re: How to count the number of open Firefox browser tabs?

Posted: 17 Nov 2013, 21:07
by jethrow

Code: Select all

list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
for each, tab in Acc_Children(list)
   t .= tab.accName(0) "`n"
MsgBox %t%

Re: How to count the number of open Firefox browser tabs?

Posted: 17 Nov 2013, 22:02
by Guest10
WOW!!! totally unbelievable, thanks! :shock: :ugeek: