Hello,
Thankyou a lot for the tip.

> and from it the location object, from which you can get the href
> property which gives you the URL (as a string).


Would you tell me which interface I should use for that "location object"? I thought it was nsIDOMLocation, but it is not included in the latest gecko-sdk I have. And how to get that interface? Directly from the nsIDOMWindow?


Thanks alot in advance.
Vonuyx



Christian Biesinger wrote:

vonuyx wrote:

// Get the web browser
nsCOMPtr<nsIWebBrowser> pWebBrowser;
pServman->GetServiceByContractID("@mozilla.org/embedding/browser/nsWebBrowser;1" , NS_GET_IID(nsIWebBrowser), getter_AddRefs(pWebBrowser));


You can't do that. This is no service; each window would have its own instace of this component. Not to mention that Mozilla and Firefox do not use nsWebBrowser.


You can get the DOM Window from aWebProgress in nsIWebProgressListener, and from it the location object, from which you can get the href property which gives you the URL (as a string).

_______________________________________________ Mozilla-xpcom mailing list [email protected] http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to