Page 7 of 7

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

Posted: 05 Aug 2018, 16:14
by JnLlnd
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...

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

Posted: 09 Aug 2018, 02:35
by Johnny R
No atnbueno, no solution. Where is atnbueno?

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

Posted: 18 Aug 2018, 08:09
by Johnny R
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!

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

Posted: 19 Aug 2018, 13:22
by JnLlnd
I confirm. This works with Firefox v61.0.2:
https://autohotkey.com/boards/viewtopic ... 81#p182981

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

Posted: 22 Oct 2018, 08:20
by hotkeyguy
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

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

Posted: 22 Oct 2018, 08:41
by JnLlnd
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

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

Posted: 21 Feb 2019, 09:43
by freespacing
Spanish version just because…
¡Hola atnbueno!
Gracias por el post con todo lujo de detalles.
Por casualidad ¿tendrías alguna sugerencia para Pale Moon?
De costumbre lo hago con JS dentro de Dorando o GreaseMonkey, pero me resultaría sumamente útil hacerlo en ahk.
Gracias y hasta pronto.

English because that's this board's language
Hello atnbueno!
Thanks for the post full of details.
Do you by any chance have any suggestions for Pale Moon?
I usually do it with JS inside Dorando or GreaseMonkey, but it would be extremely useful to do it in ahk.

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

Posted: 02 Jul 2019, 08:36
by Dest938572
atnbueno wrote:
08 Jun 2014, 13:19

Short version: The code below finds out the URL of the current (active) browser tab for most of the modern browsers.
Awesome script, thank you Antonio.
It works perfect more than 5 years.