Re: Can I get document.links in JavaXPCOM ?

Christian Biesinger <[email protected]> Wed, 04 Jul 2007 17:30:37 +0200
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <kuidnY7sOpCDIBbbnZ2dnUVZ_qjinZ2d__21341.6800172583$1183563320$gmane$org@mozilla.org>
Carfield Yim wrote:
> Thanks, that mean I need to construct the absolution URL myself...
> actually not a major problem , I just wonder can I just get from the
> API or not.

There is an API. Call QueryInterface for nsIDOMHTMLAnchorElement and 
then call getHref().

> By the way, is the relative URLs I get only is "/folder/file.html" so
> that I just add the protocol and host is ok; Or it will be only
> "file.html" so that I need to detect for this case and add folder also?

getAttribute returns whatever the web page author specified in the 
attribute...