Re: Can I get document.links in JavaXPCOM ?

Michal Ceresna <[email protected]>
Newsgroups gmane.comp.mozilla.devel.oji
Message-ID <[email protected]>
On Tuesday 03 July 2007, Carfield Yim wrote:
Hello,

> HI, is that I cannot get absolute URLs using  htmlDoc.getLinks()? I've
> tried to use the following code but I can still just get the relative
> URLs, why will that happened?

You have to resolve the relative urls against a base url.

For obtaining the base URI you can for example
query-interface browser window to a nsIWebNavigation 
and then read the currentURI property.

best regards,
Michal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.