[Project_owners] Re: Getting the right (secure) value from context menu code

Michael Vincent van Rantwijk some at universum.org
Mon May 9 17:21:55 EDT 2005


Neil wrote:
> Michael Vincent van Rantwijk wrote:
> 
>> How do I make the following line secure:
>>
>> var url = gContextMenu.target.ownerDocument.location.href;
>>
>> I hope that this is right:
>>
>> var ownerDocument = new XPCNativeWrapper(gContextMenu.target, 
>> "ownerDocument").ownerDocument;
>> var location = new XPCNativeWrapper(ownerDocument, "location").location;
>> var url = location.href;
>>
>> but what about 'target'?
> 
> 
> gContextMenu is a chrome object, so there are no issues there.

Oh, well, I got a bit confused by this code I guess:
http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/nsContextMenu.js#648

Thanks,
Michael.


More information about the Project_owners mailing list