Note that document.onmouseover is not supported by Greasemonkey with this syntax, all event listeners must be attached via addEventListener. In addition, adding further event listeners does not override the already attached ones. Regarding unsafeWindow, I don't exactly know why it is not working here. I have a couple of ideas, but it would be easier if you could point to the page in question or otherwise provide a test case, should the original page not be generally available.
On Wed, Dec 23, 2009 at 7:44 AM, Tim Benham <[email protected]> wrote: > I have googled this intensively without finding a method that works. > The page has something like > > <SCRIPT type="text/JavaScript" language="JavaScript" src="javascript/ > lame.js"></SCRIPT> > > lame.js contains > > function theirFun { // make an error } > document.onmouseover=theirFun; > > (Actually it attaches several functions with errors in them to mouse > events, causing hundreds of errors to be added to the error console > whenever I move my mouse). > > Things that don't work > ---------------------- > > * unsafeWindow.theirFun=function(){} => no change > > * document.onmouseover=function(){} => no change > > * window.addEventListener("load",function() > {document.removeEventListener("mouseover",theirFun,true)},true); > ==> "theirFun is not defined" > > * window.addEventListener("load",function() > {document.onmouseover=function(){}}) > ==> "component not available" > > * theirFun=function(){} > embedFunction(theirFun); > ==> no change -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
