How to count the number of open Firefox browser tabs?
- Coldblackice
- Posts: 24
- Joined: 13 Nov 2013, 14:39
How to count the number of open Firefox browser tabs?
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?
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/
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/
- Coldblackice
- Posts: 24
- Joined: 13 Nov 2013, 14:39
Re: How to count the number of open Firefox browser tabs?
Thanks, much obliged for that.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/
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?
Code: Select all
list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
MsgBox % list.accChildCount-1
Re: How to count the number of open Firefox browser tabs?
wow! this is totally unbelievable!
can you also create a list of each open tab "title"?


jethrow wrote:for posterity, this could be done more effectively using UIA.Code: Select all
list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass") MsgBox % list.accChildCount-1
Re: How to count the number of open Firefox browser tabs?
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?
WOW!!! totally unbelievable, thanks!



Who is online
Users browsing this forum: Bing [Bot], Chunjee, observingman, Xeo786 and 45 guests