Get the URL of the current (active) browser tab

Post your working scripts, libraries and tools
Thierry

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

15 Dec 2016, 08:56

Hello
It seems it does not work properly if I have many tabs opened. It does not return the url of the current active tab.
uhuhseo

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

13 Mar 2017, 01:50

Thanks for the code atnbueno. I have a simple implementation to get the chrome URL. What do you think?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

anidealworld
Posts: 3
Joined: 17 Feb 2017, 13:07

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

30 Mar 2017, 12:06

Thierry wrote:Hello
It seems it does not work properly if I have many tabs opened. It does not return the url of the current active tab.


Yes, sadly it grabs a specific tab/window and insists on returning that one instead of the currently active tab/window URL or last used.
burque505
Posts: 70
Joined: 22 Jan 2017, 19:37

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

31 Mar 2017, 17:08

For PaleMoon 27.2.1 (32-bit) on Win7-x64, 64-bit AHK, I get ("The URL couldn't be determined"(MozillaWindowClass")).
Chrome works, reports (Chrome_WinWidget_1).
Firefox is the fastest of the one's I've tried so far, 437ms.
Interestingly, when Thunderbird is open, if you select a message with the mouse, it gives you a URL for the message and also reports MozillaWindowClass, which I guess is no surprise.
Thanks for the script!
Cardoso

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

16 Apr 2017, 11:18

Please excuse my ignorance in this type of script, this is seeing for the first time, how can I get the data of this script in an external program, developed in vb.net, I want to capture the active url of this script. thank you.
User avatar
atnbueno
Posts: 83
Joined: 12 Oct 2013, 04:45

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

28 May 2017, 03:48

Thierry wrote:Hello
It seems it does not work properly if I have many tabs opened. It does not return the url of the current active tab.

(Sorry for not seeing your message before)

That shouldn't happen :think: Which browser/version are you using? Are you using the script from the first page unmodified?

Cardoso wrote:Please excuse my ignorance in this type of script, this is seeing for the first time, how can I get the data of this script in an external program, developed in vb.net, I want to capture the active url of this script. thank you.

Excuse my ignorance in vb.net :) but this script uses the Microsoft Active Accessibility (MSAA) API. You can find links to the relevant Microsoft documentation in https://autohotkey.com/board/topic/7730 ... -09272012/ If you are able to understand it, you will have no problem in replicating the functionality.


Regards,
Antonio
DanielToward13
Posts: 36
Joined: 18 May 2017, 10:56

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

29 May 2017, 06:28

Thanks atnbueno, great script. There is a bug and I don't know how to fix the problem. If I opened two Chrome windows (each with different tabs), the script works well but once I add a new blank tab and press the ^+!u then the script will return the previous active tab URL and after that it get stuck on that URL and couldn't identify the current tab URL anymore. Can this problem be solved?

I am using the script from the first page unmodified. Chrome browser version 58.0.3029.110 (64-bit)
hotkeyguy
Posts: 115
Joined: 11 Oct 2014, 12:22

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

29 May 2017, 18:21

Hello atnbueno,

I'm looking for a way to get (additionally) the title of the page shown in the current (active) browser tab - in my case for Firefox. Any hints are highly appreciated!


Many thanks and greetings
hotkeyguy
Guest

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

10 Sep 2017, 12:48

Hi

The problem with this lib is that its very slow once i have many (like 200) tabs opened.

Retrieving url time goes down to 1541ms on Chrome.

When i open fresh Edge browser with just one tab, the retrieval time is about 100ms.

So is there something that can be done to speed up url retrieval?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 23 guests