I'd like to be able to mouse around all script-allowed pages without immediately popping up all the onmouseover javascript "features". (I tried CSS3 transition on :hover in userContent.css, but most offenders appear to use either javascript or non-transition-able properties.) All I've been able to think of is something like: replace all
<*>onmouseover=<target_code>
with something like
<*>onmouseover=function(){let _to=setTimeout(function(){<target_code>},750);
this.onmouseout=this.onmousedown=this.onkeydown=function(){if(_to){clearTimeout(_to)}}}
(ignoring the HTML -version delimiter issue for the moment). Surrogates look promising, but I can't seem to gain enough of an understanding of them to determine if they have the power. Does anyone know, or think I should go start learning Greasemonkey, or have any other ideas?
can a surrogate delay all onmouseover scripts everywhere?
-
ken
can a surrogate delay all onmouseover scripts everywhere?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.12) Gecko/20100101 Firefox/10.0.12
Re: can a surrogate delay all onmouseover scripts everywhere
Short answer: Yes, I believe this is possible with surrogates. You may wish to read the quick reference guide. Greasemonkey should work too. But I haven't delved into what you want, so I can't be sure. My advice is to experiment and see what works
.
Mozilla/5.0 (Linux; U; Android 2.3.6; en-au; GT-S5830 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
-
ken
Re: can a surrogate delay all onmouseover scripts everywhere
> My advice is to experiment and see what works.
Lol...now now, you know what they say about making unwarranted assumptions. I actually experimented for 3 days until I reached the limit of what I could accomplish with the information I could access. I just didn't want to bore anyone with tales of the trials and tribulations endured before the resorting to the last...er...resort...of bothering anybody else. But you asked for it. I pored over about:config, and copied the entries from the preference file in the xpi (thanks, JARinspector) into a text editor and reformatted them so I could read them. I googled surrogates which led to al_9x's reference guide, and I pored over that and its 4 references and other google-returned articles (such as from hackademix) which reference it. It took me a while to realize (I think) that when al_9x says "matched script" what he really means is "matched URL to file containing script", because I tried using the three "script-matching" operators to match actual snippets of javascript code, and none seemed to do anything. Plus there's no actual examples in about:config of scripts following operators, only URLs following operators. I did succeed in using noscript.surrogate.onmouseover.sources @^http* to match all documents loaded, and noscript.surrogate.onmouseover.replacement
document.onmouseover=function(){let _to=setTimeout(function(){alert("Hello")},750); this.onmouseout=this.onmousedown=this.onkeydown=function(){if(_to){clearTimeout(_to)}}} to demonstrate adding a delayed alert to every mouseover of every object on a page (a bit of a disaster of course), but it also demonstrated how setTimeout forks instead of blocks (document-defined onmouseover scripts continued to execute immediately), and therefore how its only use would be to somehow insert the document's code inside of the setTimeout function. But I can't tell looking at the .replacement strings how to figure out which are the parts used for matching, which are the parts used for replacing, and which are the symbols used to represent the matched parts for insertion into the replaced parts. Or whether or not they are even doing that in the first place. And I can't find any more documentation to help me improve my understanding myself. So I'm fairly convinced that I can't progress further without somebody else providing me, or pointing me toward, additional information.
Lol...now now, you know what they say about making unwarranted assumptions. I actually experimented for 3 days until I reached the limit of what I could accomplish with the information I could access. I just didn't want to bore anyone with tales of the trials and tribulations endured before the resorting to the last...er...resort...of bothering anybody else. But you asked for it. I pored over about:config, and copied the entries from the preference file in the xpi (thanks, JARinspector) into a text editor and reformatted them so I could read them. I googled surrogates which led to al_9x's reference guide, and I pored over that and its 4 references and other google-returned articles (such as from hackademix) which reference it. It took me a while to realize (I think) that when al_9x says "matched script" what he really means is "matched URL to file containing script", because I tried using the three "script-matching" operators to match actual snippets of javascript code, and none seemed to do anything. Plus there's no actual examples in about:config of scripts following operators, only URLs following operators. I did succeed in using noscript.surrogate.onmouseover.sources @^http* to match all documents loaded, and noscript.surrogate.onmouseover.replacement
document.onmouseover=function(){let _to=setTimeout(function(){alert("Hello")},750); this.onmouseout=this.onmousedown=this.onkeydown=function(){if(_to){clearTimeout(_to)}}} to demonstrate adding a delayed alert to every mouseover of every object on a page (a bit of a disaster of course), but it also demonstrated how setTimeout forks instead of blocks (document-defined onmouseover scripts continued to execute immediately), and therefore how its only use would be to somehow insert the document's code inside of the setTimeout function. But I can't tell looking at the .replacement strings how to figure out which are the parts used for matching, which are the parts used for replacing, and which are the symbols used to represent the matched parts for insertion into the replaced parts. Or whether or not they are even doing that in the first place. And I can't find any more documentation to help me improve my understanding myself. So I'm fairly convinced that I can't progress further without somebody else providing me, or pointing me toward, additional information.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.12) Gecko/20100101 Firefox/10.0.12