In Firefox it's possible using the following...
HTMLDocument.prototype.__defineGetter__("cookie",function (){return "foo=bar";});
HTMLDocument.prototype.__defineSetter__("cookie",function (){});
This doesn't cause any errors in WebKit, and WebKit definitely supports __defineGetter__
and __defineSetter__
, but it doesn't work. Guessing WebKit is protecting that property somehow.
So, any ideas of how to achieve the same effect in WebKit?