Get the URL of the current (active) browser tab

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
atnbueno
Posts: 89
Joined: 12 Oct 2013, 04:45
Contact:

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

04 Jan 2018, 12:05

Ouch :wtf:

I'm looking into it. The URL is still there, and it's accessible via ACC, so it looks promising :think:

Big thanks to Kudos for the heads up :thumbup:


Regards,
Antonio
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

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

04 Jan 2018, 12:26

Good news! Thanks atnbueno.
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

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

05 Jan 2018, 21:13

atnbueno wrote:Ouch :wtf:

I'm looking into it. The URL is still there, and it's accessible via ACC, so it looks promising :think:

Big thanks to Kudos for the heads up :thumbup:


Regards,
Antonio
Could this script be modified to get the Status Bar information (or whatever it's called now) at the bottom left of most browsers?
User avatar
atnbueno
Posts: 89
Joined: 12 Oct 2013, 04:45
Contact:

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

06 Jan 2018, 03:28

No, sorry. The status bar is not available via the API this script is based on.

BUT it's trivial to access it via JavaScript: https://developer.mozilla.org/en-US/doc ... dow/status
JasonDavisFL
Posts: 12
Joined: 12 Jan 2018, 13:05
Contact:

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

17 Jan 2018, 12:44

Is there a way to get a list of all browser tabs open in chrome?
DigiDon
Posts: 178
Joined: 19 May 2014, 04:55
Contact:

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

06 Feb 2018, 10:27

Hello all,

I was using this great script in one of my program and have been informed that it had some problems in Firefox.

Atnbueno, did you make progress on the fix? Any hint ?

JnLlnd or Jeeswg : any new info on the bug?

Thanks! ;)

EDIT : I have just tested JnLlnd's script in previous page and the URL in Firefox 58 seem to work well (I have tried 5/6 urls).
So does someone still have a problem? Can we have a URL example of where it was failing?
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic
Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:
Sorry I am working hard at the moment at a new job and can't commit on delays of answers & updates
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

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

07 Feb 2018, 08:59

DigiDon wrote:I have just tested JnLlnd's script in previous page and the URL in Firefox 58 seem to work well (I have tried 5/6 urls).
So does someone still have a problem? Can we have a URL example of where it was failing?
I retested it with 57.0.4 and upgraded to 58.0.1 today and found no URL not working with both versions. This is kind of good news :-)
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
DigiDon
Posts: 178
Joined: 19 May 2014, 04:55
Contact:

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

07 Feb 2018, 09:01

cool ! :D
So maybe a glitch on Firefox side ! eheh
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic
Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:
Sorry I am working hard at the moment at a new job and can't commit on delays of answers & updates
User avatar
JoeSchmoe
Posts: 129
Joined: 08 Dec 2014, 08:58

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

09 Feb 2018, 12:55

Thanks for continuing to maintain, ATNBueno. You're the best. :)
iHaveDepression
Posts: 1
Joined: 18 Feb 2018, 01:43

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

18 Feb 2018, 02:20

how exactly can I use this script?
rangerr
Posts: 2
Joined: 26 Feb 2018, 14:35

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

27 Feb 2018, 14:06

Is it possible to have this code activate a hotstring only if the tab URL contains a string?
User avatar
RobbieWilkes
Posts: 14
Joined: 27 Feb 2018, 21:52

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

01 Mar 2018, 00:44

rangerr wrote:Is it possible to have this code activate a hotstring only if the tab URL contains a string?
Ultimately I'd like to know the same thing, as it would save me some lines of code in order to determine which page I was on, and not have to eliminate each option.

I am really at the learning phase of AHK, and am still figuring out the big stuff, but, my goal would be to use the functionality in my YouTubeTV script. There are, currently, essentially 4 different URLs used

youtubetv.com/
youtbetv.com/library
youtubetv.com/live
youtubetv.com/watch/gobbledlygoop (where the gobbledygoop is, apparently, random text related to the currently playing live video)

When not on the "watch" (live video) URL, I'd like for my MCE Remote direction buttons (right, left, up, down) to move the mouse in the appropriate direction, using "MouseMove", but, when on the "watch" screen, it will use those buttons for video control (Left - jump back / Right / jump forward).

Of course, since the "gobbledygoop" is there, I'll have to code for all the OTHER screens, unless I can parse or test the variable.

Could it be done with an "if Var contains" statement?

if sURL contains watch
Send Right
else
MouseMove 100, 0, 1, R
Return

Anyway, thanks for the awesome work! As I learn more, this is going to be extremely handy!
User avatar
RobbieWilkes
Posts: 14
Joined: 27 Feb 2018, 21:52

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

01 Mar 2018, 20:08

rangerr wrote:Is it possible to have this code activate a hotstring only if the tab URL contains a string?
Works like a champ. I'm very happy!

Right::
{
sURL := GetActiveBrowserURL()
WinGetClass, sClass, A
if sURL contains watch
send l
else
MouseMove 250, 0, 1, R
Return
}

Thanks atnbueno for your awesome work! Don't guess you'd have any idea how to SEND a URL to Chrome while in Kiosk mode, would you? :D
zhanglei1371
Posts: 28
Joined: 05 Aug 2014, 02:01

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

16 May 2018, 18:35

Hi everyone,my browser is 360se,and the class is 360se6_Frame.
I used the code in page 1,then it poped the message:
"Not a browser or browser not supported (360se6_Frame)"
how to modify to fit the 360se?
Thx.
my brower download url:
http://down.360safe.com/se/360se9.1.0.420.exe
Kudos
Posts: 7
Joined: 23 Aug 2015, 05:52

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

03 Jul 2018, 03:25

Hey Antonio,

I was wondering if you know how to make your script work for Brave browser - https://brave.com/

Thanks!
Kudos
garry
Posts: 3720
Joined: 22 Dec 2013, 12:50

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

03 Jul 2018, 07:10

just an example for firefox

Code: Select all

;- alt+ctrl+F   example copy url in firefox
#If WinExist("ahk_exe firefox.exe")
clipboard=
return

!^F::
WinActivate
sleep,500
sendinput,!s
sleep,500
sendinput, ^c
clipwait,2
URL:=clipboard
msgbox,%url%
clipboard=
url=
return
#If
IBARON

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

13 Jul 2018, 16:57

Hi, The Code From The First Post Works On All Browsers Except Firefox Version 61 Where It Bombs Out With Error 0x80004003
Invalid Pointer accChildCount Any Solution Please
please don't duplicate posts!
Johnny R
Posts: 348
Joined: 03 Oct 2013, 02:07

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

03 Aug 2018, 13:15

I have the same problem. The script doesn't work with Firefox v61.0.1. The row Acc_Init(), cChildren:=Acc.accChildCount, Children:=[] causes the Error 0x800706B5 - Die Schnittstelle ist unbekannt (The interface is unknown). Is there a solution, please ?
Image
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

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

05 Aug 2018, 00:07

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

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 80 guests