; if only 1 tab exists, grab info, push to array and exit early
if(TotalTabsFound = 1){
@ -813,7 +814,7 @@ CreateArrayOfTabs() {
StartTime := A_TickCount
Loop, {
Message = Creating an Array of All Chrome Tabs`nCurrent Loop: %A_index%/%TotalTabsFound% (Cannot loop through unloaded tabs)`nSometimes might get stuck for a short while if there is something loading in active tab
Message = Creating an Array of All Chrome Tabs`nCurrent Loop: %A_index%/%TotalTabsFound%`nSometimes might get stuck for a short while if there is something loading in active tab
loop % NumberOfTabLoops { ; loop through tabs to find matching tab
; loop through tabs to find matching tab
loop % NumberOfTabLoops {
try driver.SwitchToNextWindow()
; sleep, 1000
; msgbox, looping through tabs
try CurrentTabTitle := driver.window.title
try CurrentTabURL := driver.Url
; DevModeMsgBox(CurrentTabURL)
; DevModeMsgBox(CurrentTabTitle)
; caused by tab being manually closed. Not sure if this is the only cause though.
if(CurrentTabTitle = "") {
Message = CurrentTabTitle: %CurrentTabTitle%
DevModeMsgBox(Message)
; DevModeMsgBox(Message)
Message = CurrenttabURL: %CurrentTabURL%
DevModeMsgBox(Message)
; DevModeMsgBox(Message)
; try driver.SwitchToNextWindow
Continue
}
try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, URLBase)){
; msgbox, found it.`n%CurrentTabTitle% = %PageTitle%`n%CurrentTabURL% = %URLBase%
TabFoundSuccessfully := 1
; msgbox %CurrentTabTitle% = %PageTitle%
; message = %CurrentTabTitle%: %PageTitle%
; DevModeMsgBox(message)
; msgbox %CurrentTabURL% = %URL%
Break
}
}
}
; if failed to switch to tab and a new tab was not created, then chrome failed to switch to the tab
; this happens sometimes. most likely to a chromedriver bug or maybe tab being offloaded?
if(!TabFoundSuccessfully AND !NewTabCreated){
; @todo : not sure how to best solve this problem currently. It doesn't happen very often.
; last time it happened was when there were only 2 chrome tabs open, gab + subscribestar. chrome was stuck on subscribestar page and wouldn't nextwindow() to gab