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

Carlos Retamales carlosretamales at gmail.com
Sun May 22 08:14:33 EDT 2005


*Stop to send messages to me.....STOOOOPPPPPPPPP*
*Pare de encaminar mensajes para mi. Pareeee*
   project_owners at mozdev.org
project_owners at mozdev.org

---------- Forwarded message ----------
From: Michael Vincent van Rantwijk <some at universum.org>
Date: 11/05/2005 09:02
Subject: [Project_owners] Re: Getting the right (secure) value from context 
menu code
To: project_owners at mozdev.org

Neil wrote:
> Michael Vincent van Rantwijk wrote:
>
>> Neil wrote:
>>
>>> Michael Vincent van Rantwijk wrote:
>>>
>>>> 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
>>>>
>>>
>>>
>>> Well, you'll notice that it doesn't bother to wrap "this.target" ...
>>
>>
>> As in it isn't needed there, because 'this' is the chrome popup?
>
>
> It's the chrome variable, yes.
>
> Your clock's time's still wrong. Maybe your time is so far out that your
> timesync app can't cope. Make sure that your local timezone is correct
> as well as your local time.

Yes, the timezone was still incorrect, thanks for pointing me into the
right direction.

Michael.
_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20050522/01f2958c/attachment.htm


More information about the Project_owners mailing list