Get url from active tab of browser with VBS or JS
Script gets executed by double click on icon (ie on descktop), browser is already open.
By the way how I could have the code implemented for Mozilla (or what is suposed to be in another code)?
I have the code below that is working perfectly on IE 6 and 7 but it only gets url from tab that has been loaded last, even if this one is not active (open) right now.
Faced to the issue that need to get url of active (open) page, not the last loaded.
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows
For i = 0 to objShellWindows.Count - 1
If TypeName(objShellWindows.Item(i).Document) = "HTMLDocument" Then
Value = objIE.LocationURL
Re: Get url from active tab of browser with VBS or JS
Ok I guess it is nesessary to make some futher explanations to obtain some help.
So: I produce some activity on already open browser (IE 7 or firefox). From time to time I need to do following:
Among several open tabs I need to get url from ACTIVE one.
Therefore I created very simple script as you see in first post.
But there are two issues that I faced to:
FIRST - sometimes script takes url NOT from the active tab, but from last loaded (or used or I do not know what)
SECOND - VBS is no good for Firefox, so I am wondering - is it possible to create similar script with JS ( file not tied to html, saved on desktop and being executed by dobleclicking).