[webkit-help] window.console attribute cannot be set to readOnly

bai baizhenxuan at gmail.com
Tue Mar 1 04:48:43 PST 2011


Hi ,all:
 I'm using QtWebkit on Windows,i wan to make sure the console object and
it's attributes are  readonly in javascript,

first of all,I change JSDomWindow.cpp ,
change the attribute console of window  to readOnly( it seems useless).
    { "console", DontDelete|ReadOnly, (intptr_t)jsDOMWindowConsole,
(intptr_t)setJSDOMWindowConsole },

then I edit JSConsole.cpp,
change the attribute  log of console to readOnly.
   { "log", DontDelete|Function|ReadOnly,
(intptr_t)jsConsolePrototypeFunctionLog, (intptr_t)setJSDOMWindowConsoleAttr
},

but with the following javascript statements:
console.log("test");
try{
console.log=function(){}
}
catch(ex) {
alert("exception");
}
console.log("test2");

the output is :
test

there is no test2 at all;

thanks



-- 
bai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20110301/c24af908/attachment.html>


More information about the webkit-help mailing list