Get the URL of the current (active) browser tab

Post your working scripts, libraries and tools
User avatar
JnLlnd
Posts: 272
Joined: 29 Sep 2013, 21:29
GitHub: JnLlnd
Location: Montreal, Quebec, Canada
Contact:

Re: Get the URL of the current (active) browser tab

05 Aug 2018, 16:14

AHKStudent wrote:in chrome 67 and 68 if you have a new tab window as the main window this wont work

to test click to get a new tab in chrome and then run to get list of windows, u will get blank even if you have 5 other regular websites opne
@AHKStudent: If we are talking of the same function GetActiveBrowserURL(), this function retrieves the active tab's URL. What you describe is not an error since there is no URL to retrieve in a blank tab.

@atnbueno: I hope you or another wizard here will be able to look into the Firefox issue...
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
Johnny R
Posts: 237
Joined: 03 Oct 2013, 02:07

Re: Get the URL of the current (active) browser tab

09 Aug 2018, 02:35

No atnbueno, no solution. Where is atnbueno?
Johnny R
Posts: 237
Joined: 03 Oct 2013, 02:07

Re: Get the URL of the current (active) browser tab

18 Aug 2018, 08:09

I've reinstalled the newest version of the script and the problem was solved. The script works fine with Firefox v61.0.2. Thank You all!
User avatar
JnLlnd
Posts: 272
Joined: 29 Sep 2013, 21:29
GitHub: JnLlnd
Location: Montreal, Quebec, Canada
Contact:

Re: Get the URL of the current (active) browser tab

19 Aug 2018, 13:22

I confirm. This works with Firefox v61.0.2:
https://autohotkey.com/boards/viewtopic ... 81#p182981
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
hotkeyguy
Posts: 127
Joined: 11 Oct 2014, 12:22

Re: Get the URL of the current (active) browser tab

22 Oct 2018, 08:20

I'm using JnLlnds code. With Firefox 62.0.3, I get sometimes two error messages
1. An error occurred in the secure channel support
followed by
2. The data necessary to complete this operation is not yet available.

The affected lines are objWebRequest.Send() ; and return (objWebRequest.StatusText() = "OK" ? objWebRequest.ResponseText() : "") in function Url2Var(strUrl):

Code: Select all

;------------------------------------------------------------
Url2Var(strUrl)
;------------------------------------------------------------
{
	objWebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
	/*
	if (A_LastError)
		; an error occurred during ComObjCreate (A_LastError probably is E_UNEXPECTED = -2147418113 #0x8000FFFFL)
		BUT DO NOT ABORT because the following commands will be executed even if an error occurred in ComObjCreate (!)
	*/
	objWebRequest.Open("GET", strUrl)
	objWebRequest.Send() ; <== ERROR 1

	return (objWebRequest.StatusText() = "OK" ? objWebRequest.ResponseText() : "") ; <== ERROR 2
}
;------------------------------------------------------------
That happens e. g. with GitHub pages, like GitHub - nshalabi/SysmonTools: Utilities for Sysmon.
I assume that's an certificate validation issue? I tried Sleep instructions without success.


Many thanks for all your efforts and any hints
hotkeyguy
User avatar
JnLlnd
Posts: 272
Joined: 29 Sep 2013, 21:29
GitHub: JnLlnd
Location: Montreal, Quebec, Canada
Contact:

Re: Get the URL of the current (active) browser tab

22 Oct 2018, 08:41

Hi,

> I'm using JnLlnds code. With Firefox 62.0.3, I get sometimes two error messages

I tried only a few times but it worked with the same Firefox version.

BTW, I worked on in but I'm not the one who wrote the "core" of the code. It is from atnbueno.

Jean
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 43 guests