added function to get the baseurl of current tab, small bug fix within chrome tab activation function

main
Yuriy 2 years ago
parent c5be14ba23
commit 4eada9ea76

@ -15,6 +15,12 @@ CheckCurrentTabForCurrentSite(){
*/ */
GetCurrentTabURlBase(){
try, TabURL := driver.url
TabURL := ExtractBaseURL(TabURL)
return TabURL
}
ExtractBaseURL(URL){ ExtractBaseURL(URL){
URLBase := StrReplace(URL,"https://","") ; remove beginning of URL URLBase := StrReplace(URL,"https://","") ; remove beginning of URL
@ -76,7 +82,7 @@ NavigateFromBaseURLTo(URL,PageTitle := "TodoDeleteme"){
ChromeTabsURLArray.Push(URL) ; Append the new url to the array ChromeTabsURLArray.Push(URL) ; Append the new url to the array
NewTabCreated := 1 NewTabCreated := 1
sleep, 1000 sleep, 1000
status := ActivateChromeTab(URLBase) status := ActivateChromeTab(URL)
if(Status = "Failed"){ if(Status = "Failed"){
Message = Failed to activate tab for %urlBase% after 2 atteppts. Chrome stuck on a dialog box of some sort? Message = Failed to activate tab for %urlBase% after 2 atteppts. Chrome stuck on a dialog box of some sort?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
@ -122,9 +128,10 @@ NavigateFromBaseURLTo(URL,PageTitle := "TodoDeleteme"){
} }
; -------------------------------ActivateChromeTab-------------------------------
ActivateChromeTab(URL){ ActivateChromeTab(URL){
; convert to baseUR
; Extract Base URL if necessary
if(InStr(URL, "/")){ if(InStr(URL, "/")){
URLBase := ExtractBaseURL(URL) URLBase := ExtractBaseURL(URL)
} }

Loading…
Cancel
Save