[Project_owners] Re: URL of current document

Neil neil at parkwaycc.co.uk
Fri Aug 26 22:52:47 EDT 2005

Neil Deakin wrote:

> Michael Vincent wrote:
>> Neil Deakin wrote:
>>> Michael Vincent wrote:
>>>> Philip Chee wrote:
>>>>> 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?
> The location property can't be overriden by scripts so it doesn't have 
> the security issue that other properties have, unless you're referring 
> to something else.

Actually without wrappers content.location will refer to an <iframe 
name="location"> if there is one.

More information about the Project_owners mailing list