www.emsdn.com
Class Profile: Home »» Mozilla [Mozilla] under "Mozilla" »»» How to get the URL/ URI of the current browser
How to get the URL/ URI of the current browser
Can someone please tell me how to get the URI of the current browser
window, for firefox, using Javascript
I made an XPCM component, and I have a small UI, a XUL page, accessed
from the browser toolbar. I would like to get the current url and pass
it on to the object, through the script.
I tried getting the nsIWebBrowser, QI'd it for nsIWebNavigation, to get
the currentURI, but it keeps saying it is undefined. This is the first
time I am writing Javascript.
If someone knows how to do it, please let me know.
thanks,
lav
dev-tech-xpcom mailing list
dev-tech-xpcom (AT) lists (DOT) mozilla.org
No. 1# | By Developer Tags User at [2008-5-5] | size: 390 bytes
lav wrote:
Can someone please tell me how to get the URI of the current browser
window, for firefox, using Javascript
You probably want to ask the window watcher for the activeWindow
I tried getting the nsIWebBrowser
Firefox doesn't use nsIWebBrowser.
-Boris
dev-tech-xpcom mailing list
dev-tech-xpcom (AT) lists (DOT) mozilla.org
No. 1# | By Developer Tags User at [2008-5-5] | size: 709 bytes
HI Boris thanks for the response.
I tried getting the
that still keeps returning the XUL's location on the system, the chrome
path, similar to what window.location wd return.
Do I have to get the actual URL window and then get its value?
thanks
lav
Boris Zbarsky wrote:
lav wrote:
Can someone please tell me how to get the URI of the current browser
window, for firefox, using Javascript
You probably want to ask the window watcher for the activeWindow
I tried getting the nsIWebBrowser
Firefox doesn't use nsIWebBrowser.
-Boris
dev-tech-xpcom mailing list
dev-tech-xpcom (AT) lists (DOT) mozilla.org
No. 1# | By Developer Tags User at [2008-5-5] | size: 663 bytes
lav wrote:
I tried getting the
that still keeps returning the XUL's location on the system, the chrome
path, similar to what window.location wd return.
If you have the chrome window you can get the current tab from it How to do
this isn't really an XPCM issue, since it somewhat depends on the exact app
involved. Something like activeWindow.content might work.
That said, I'm suprised that activeWindow returns the XUL window. That's not
what I would have expected from the window watcher in general
-Boris
dev-tech-xpcom mailing list
dev-tech-xpcom (AT) lists (DOT) mozilla.org
No. 1# | By Developer Tags User at [2008-5-5] | size: 809 bytes
I am getting the url using this.
alert();
Check whether this is what you need
Thanks
Vinod
Boris Zbarsky wrote:
lav wrote:
I tried getting the
that still keeps returning the XUL's location on the system, the chrome
path, similar to what window.location wd return.
If you have the chrome window you can get the current tab from it How to do
this isn't really an XPCM issue, since it somewhat depends on the exact app
involved. Something like activeWindow.content might work.
That said, I'm suprised that activeWindow returns the XUL window. That's not
what I would have expected from the window watcher in general
-Boris
dev-tech-xpcom mailing list
dev-tech-xpcom (AT) lists (DOT) mozilla.org
Mozilla Hot!
Mozilla New!
Copyright © 2008 www.emsdn.com • All rights reserved • CMS Theme by www.emsdn.com - 0.297