Well... Ok it doesn't work >_<
It is stange, delete returns false but you can still set the value...

Anyway, I use document.body.innerHTML += 'iframe whatever';
document is protected
setting body will throw a DOM error, maybe it wants a dom object
innerHTML is a property and i don't think you can delete it

At the beginning I thought there was going to be a magical way to
restore it but it appears there isn't...
So I guess the best way of dealing with the possibility of having it
missing is either:
- having a polyfill ready
- looking if it is there and if not not runninhg the script
- assuming your script will be runned first and getting it in a private variable

On Sun, Aug 28, 2011 at 10:54 PM, Lasse Reichstein
<[email protected]> wrote:
>
>
> On Sun, Aug 28, 2011 at 10:28 PM, Xavier MONTILLET <[email protected]>
> wrote:
>>
>> Well I just delete document.createElement which restores the default value
>> :-*
>> It works on everything but the properties of Object.prototype
>> apparently...
>
> The overwrite was done on the prototype object that createElement was
> inherited from, i.e.,  document.__proto__.__proto__.createElement =
> myFunction (in Chrome, other browsers may or may not have different
> prototype chains).
> In that case, deleting it won't help.
> /L
>>
>> On Sun, Aug 28, 2011 at 10:21 PM, Michael Geary <[email protected]> wrote:
>> > OK, you got me. You can protect yourself when I overwrite
>> > Object.prototype.hasOwnPrototype.
>> > But you didn't notice that I'm a more clever bad guy than that.
>> > In addition to simply overwriting that method in the current window, I
>> > also
>> > ran a loop that replaces that method in every existing iframe. And I
>> > replaced document.createElement() with my own version that overwrites
>> > the
>> > hasOwnPrototype method when you create a new iframe.
>> > Your move. :-)
>> > (Which leads me to my real question, what is the actual problem we're
>> > trying
>> > to solve?)
>> > -Mike
>> >
>> > --
>> > To view archived discussions from the original JSMentors Mailman list:
>> > http://www.mail-archive.com/[email protected]/
>> >
>> > To search via a non-Google archive, visit here:
>> > http://www.mail-archive.com/[email protected]/
>> >
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> >
>>
>> --
>> To view archived discussions from the original JSMentors Mailman list:
>> http://www.mail-archive.com/[email protected]/
>>
>> To search via a non-Google archive, visit here:
>> http://www.mail-archive.com/[email protected]/
>>
>> To unsubscribe from this group, send email to
>> [email protected]
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to