Mozilla

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • How to get the URL/ URI of the current browser

    4 answers - 668 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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 | | 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.2 | | 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.3 | | 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.4 | | 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

Re: How to get the URL/ URI of the current browser


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "Mozilla"

EMSDN.COM