|
|
|
@ -97,92 +97,65 @@ CreateArrayOfChromeTabs() {
|
|
|
|
|
ChromeTabsURLArray := []
|
|
|
|
|
|
|
|
|
|
try TotalTabsFound := Driver.Windows.Count
|
|
|
|
|
; Message = TotalTabsFound: %TotalTabsFound%
|
|
|
|
|
; DevModeMsgBox(Message)
|
|
|
|
|
; DevModeMsgBox(TotalTabsFound)
|
|
|
|
|
|
|
|
|
|
/* ; if only 1 tab exists, grab info, push to array and return
|
|
|
|
|
if(TotalTabsFound = 1){
|
|
|
|
|
try Title := Driver.Title
|
|
|
|
|
try URL := Driver.URL
|
|
|
|
|
|
|
|
|
|
if(Title != "")
|
|
|
|
|
DriverTitleArray.Push(Title)
|
|
|
|
|
if(URL != "")
|
|
|
|
|
ChromeTabsURLArray.Push(URL)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
; Msgbox % "TotalTabsFound: " TotalTabsFound
|
|
|
|
|
; if(DevMode)
|
|
|
|
|
; Msgbox % "TotalTabsFound: " TotalTabsFound
|
|
|
|
|
; msgbox % "total Tabs:" Driver.Windows.Count
|
|
|
|
|
; Message = Creating an Array of Chrome Tabs
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
StartTime := A_TickCount
|
|
|
|
|
|
|
|
|
|
; StartTime := A_TickCount
|
|
|
|
|
; Sleep, 1000
|
|
|
|
|
StartTime := A_TickCount
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; 5 is arbitrary number to do some extra loops to make sure all tabs are gone through
|
|
|
|
|
; most likely not necessary because unloaded tabs cannot be activated
|
|
|
|
|
TotalTabLoops := TotalTabsFound + 5
|
|
|
|
|
|
|
|
|
|
; 5 is arbitrary number to do some extra loops to make sure all tabs are gone through
|
|
|
|
|
; most likely not necessary because unloaded tabs cannot be activated
|
|
|
|
|
TotalTabLoops := TotalTabsFound + 5
|
|
|
|
|
; Message = TotalTabLoops: %TotalTabLoops%
|
|
|
|
|
; DevModeMsgBox(message)
|
|
|
|
|
Message = Total Pre-Existing Tabs in Chrome: %TotalTabsFound%`nTotal Times looping through tabs to create Chrome Tabs Array: %TotalTabLoops%
|
|
|
|
|
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Message = Creating an Array of All Chrome Tabs`n(Sometimes might get stuck for a short while if there is something loading in a tab)
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
; TooltipThis(Message)
|
|
|
|
|
Message = Creating an Array of All Chrome Tabs`n(Sometimes might get stuck for a short while if there is something loading in a tab)
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
Message = Total Times looping through tabs to create Chrome Tabs Array: %TotalTabLoops%
|
|
|
|
|
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
Loop % TotalTabLoops {
|
|
|
|
|
Loop % TotalTabLoops {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try Title := Driver.Title
|
|
|
|
|
try URL := Driver.URL
|
|
|
|
|
try Title := Driver.Title
|
|
|
|
|
try URL := Driver.URL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Title != "")
|
|
|
|
|
DriverTitleArray.Push(Title)
|
|
|
|
|
if(URL != "")
|
|
|
|
|
ChromeTabsURLArray.Push(URL)
|
|
|
|
|
if(Title != "")
|
|
|
|
|
DriverTitleArray.Push(Title)
|
|
|
|
|
if(URL != "")
|
|
|
|
|
ChromeTabsURLArray.Push(URL)
|
|
|
|
|
|
|
|
|
|
; exit after looping through 1 tab, if only 1 tab found in count
|
|
|
|
|
if(TotalTabsFound = 1 AND A_index > TotalTabsFound){
|
|
|
|
|
Message = Exiting Early after 1 loop. Only 1 tab found
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
; DevModeMsgBox(message)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
; exit after looping through 1 tab, if only 1 tab found in count
|
|
|
|
|
if(TotalTabsFound = 1 AND A_index > TotalTabsFound){
|
|
|
|
|
Message = Exiting Early after 1 loop. Only 1 tab found
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
; DevModeMsgBox(message)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabEndTime := A_TickCount - TabFoundStartTime
|
|
|
|
|
TabEndTimeArray .= TabEndTime . ","
|
|
|
|
|
TabEndTime := A_TickCount - TabFoundStartTime
|
|
|
|
|
TabEndTimeArray .= TabEndTime . ","
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Message = Time to switch to new tab: %TabEndTime%`nCurrent Loop: %A_index%/%TotalTabsFound%
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
; Message = Time to switch to new tab: %TabEndTime%`nCurrent Loop: %A_index%/%TotalTabsFound%
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
TabFoundStartTime := A_TickCount
|
|
|
|
|
TabFoundStartTime := A_TickCount
|
|
|
|
|
|
|
|
|
|
; TimeToGrabCurrentTab := A_TickCount - StartTime
|
|
|
|
|
; Msgbox % "TimeToGrabCurrentTab: " TimeToGrabCurrentTab
|
|
|
|
|
; TimeToGrabCurrentTab := A_TickCount - StartTime
|
|
|
|
|
; Msgbox % "TimeToGrabCurrentTab: " TimeToGrabCurrentTab
|
|
|
|
|
|
|
|
|
|
; Stop page refresh if it's happening
|
|
|
|
|
; try driver.executeScript("return window.stop")
|
|
|
|
|
; Stop page refresh if it's happening
|
|
|
|
|
; try driver.executeScript("return window.stop")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; TimeToGrabCurrentTab := A_TickCount - StartTime
|
|
|
|
|
; Msgbox % "TimeToGrabCurrentTab: " TimeToGrabCurrentTab
|
|
|
|
|
; VAR := HasVal(ChromeTabsURLArray, STRINGVAR) ; returns position of value in array
|
|
|
|
|
; TimeToGrabCurrentTab := A_TickCount - StartTime
|
|
|
|
|
; Msgbox % "TimeToGrabCurrentTab: " TimeToGrabCurrentTab
|
|
|
|
|
; VAR := HasVal(ChromeTabsURLArray, STRINGVAR) ; returns position of value in array
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if(HasVal(ChromeTabsURLArray, URL)){ ; returns position of value in array
|
|
|
|
|