"Chuck Anderson" wrote:
> Is there a way to block mouseover (JavaScript) or hover (css) poups? I want
> to stop those annoying ads that are constantly popping up and obscuring page
> content. I do not want to disable Javascript, just onMouseover events.
> Disabling popups caused by css hover would be nice, too.
>
> Is there any way to do either or both (without simply disabling Javascript or
> css)?
I have a favorite (in IE, imported into FF) that has the following
"target" value (as one very long line although shown wrapped below):
javascript:function
r(d){d.oncontextmenu=null;d.onselectstart=null;d.ondragstart=null;d.onkeydown=null;d.onmousedown=null;
d.body.oncontextmenu=null;d.body.onselectstart=null;d.body.ondragstart=null;d.body.onkeydown=null;
d.body.onmousedown=null;};function
unify(w){r(w.document);if(w.frames.length>0){for(var
i=0;i<w.frames.length;i++){try{unify(w.frames[i].window);}catch(e){}};};};unify(self);
This is a javascript method. I found it when trying to figure out how
to undo web pages that disabled the mouse right-click (oncontextmenu)
event in that web page; i.e., they don't want you easily looking at the
page's source code, copy text, etc. Basically after loading a web page
(the document), you use this shortcut to run your own javascript that
redefines their events that were defined in their document. That is,
you can redefine those events by subsequently running your own
javascript. Notice, for example, the bookmarked javascript redefines
the following events:
oncontextmenu
onselectstart
ondragstart
onkeydown
onmousedown
I suppose you could update it to also redefine the onmouseover event. I
haven't needed that yet. In most cases, the offensive onmouseover
events are those to spam, like Intellitext ads. These are created by
using a table of keywords that may be present in the text of a web page.
The page's javascript finds those words from its table in the document
and then modifies the HTML for that text to become a mouseover event.
The result is that when you hover your mouse over double-underlined
words then the javascript opens a fake popup window (CSS frame) with an
ad based on that keyword.
A much easier way to get rid of those onmouseover events used to display
spam is to use an ad blocker. In IE, I created an .xml file using the
syntax for the InPrivate Filter available in IE7, and later. I add ad
sites to the .xml file which will block their access within a web page.
Note that the InPrivate Filter only works to block 3rd party content, so
adding a filter to block 3rd party content from
doubleclick.net does not
prevent me from visiting
doubleclick.net (as the 1st party content).
There is an .xml file obtained from culling filters from the AdBlock
Plus list that I could use in IE but I prefer to roll my own filtering
in IE. If you run into a problem in IE with rendering a site due to
blocking some 3rd party content within it (that is, script in a document
can check if you block off-domain content and refuse to show you all of
the document), disabling the InPrivate Filter in IE is pretty easy: just
click on the icon in the status bar. In Firefox, you can use the
AdBlock Plus add-on. There, too, you can quickly enable/disable the
add-on but I usually just *temporarily* permit scripts (after I first
visit there with all scripts disabled).