I need to get the url from a tab I added through:
var url = "myurl.htm";
var myTab = getBrowser().addTab(url);
I've successfully used content.location on Chrome elements, but can't
find the resource that will point me towards the same from the XUL
object returned by addTab.
Thanks in advance!
Hi,
Thanks in advance!
_______________________________________________
dev-extensions mailing list
dev-ext...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions
cc'ing the list...looks like you forgot. There's more than one way to do this. Assuming you know the index of the tab:
getBrowser().getBrowserAtIndex(0).currentURI.spec
see also: http://kb.mozillazine.org/Getting_Current_URL
-Eric
----- Original Message ----
From: rob rhyne <r...@biglike.com>
To: Eric H. Jung <eric...@yahoo.com>
Sent: Tuesday, November 7, 2006 6:41:25 PM
Subject: Re: Get URL from addTab - XUL object
Eric, thanks for the reply.
Good tip Eric. I am actually waiting for the tab to load. Getting the URL will be called from another function after the page has loaded.
Can anyone point me to how to access the url from the opened tab?
r.o.b.r.h.y.n.e.
That's just the push I needed.
I got the index of my added tab...
tabIndex = gBrowser.mTabContainer.selectedIndex;
Then retrieved my tab with:
var myTabUrl = getBrowser().getBrowserAtIndex
(tabIndex).currentURI.spec;
Thanks a ton!
>I need to get the url from a tab I added through:
>
>var url = "myurl.htm";
>var myTab = getBrowser().addTab(url);
>
>
var myBrowser = getBrowser().getBrowserForTab(myTab);
var myURL = myBrowser.currentURI.spec;
--
Warning: May contain traces of nuts.