[Project_owners] Re: URL of current document

Michael Vincent mv_van_rantwijk at yahoo.com
Fri Aug 26 20:33:36 EDT 2005


Neil Deakin wrote:
> Michael Vincent wrote:
> 
>> Philip Chee wrote:
>>
>>> Hi
>>>
>>> What's the recommended way from chrome of getting the URL of the current
>>> document being displayed in a window?
>>>
>>> document.location.href
>>> window.document.location
>>> window.location.href
>>> document.url
>>
>>
>> I would say: getBrowser().mCurrentBrowser.currentURI.spec
> 
> That is more like the absolute worst way to do it, actually.
> 
> content.location is more correct.

Yes, that is cleaner, but it should not be used if your extension 
supports older Mozilla builds because of (the now fixed) security 
issues, right?


More information about the Project_owners mailing list