I visit a website with a javascript file in the head of the HTML
<script language="javascript" src="javscript.js"></script>
The code inside this file is:
// keypress management
if (document.layers) document.captureEvents(Event.KEYPRESS)
function update(e) {
if (document.all) { // Explorer
if (event.keyCode==13) document.forms[0].submit(); // 13 = ENTER
else if (event.keyCode==26) runHelp(hplk); // 26 = CTRL+Z
return;
} else { // mozilla
if (e.which==13) document.forms[0].submit(); // 13 = ENTER
else if (e.which==26) runHelp(hplk); // 122 = CTRL+Z
return;
}
}
document.onkeypress=update;
I want to disable/remove/replace this function with Greasemonkey.
I tried it with
unsafeWindow.update = function(){}
with no result! (got no errors in the console)
is there a way to kill this function?