[Project_owners] Opening URI in Current Window

Neil neil at parkwaycc.co.uk
Wed Mar 2 12:52:55 EST 2005

HJ wrote:

> Bradley Rintoul wrote:
>> What I want to do is simply open a URI in the current window and I've 
>> done some searching on locating the current browser window and seen 
>> some references to using nsIWindowMediator.  However, I've found the 
>> following code works:
>>            var wnd = window.parent.document.getElementById( "content" );
>>            if( wnd != null ) wnd.contentWindow.location.href = theURL;
>> Is there any downside to using this?
> Yes there is, you might run into security issue because these 
> properties can be set/changed by web authors.

Good point, although I think you'll need <iframe name="location"> to 
trigger the bug, as .location is otherwise fairly well protected.

More information about the Project_owners mailing list