Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Block onMouseover (hover) popups

3,204 views
Skip to first unread message

Chuck Anderson

unread,
Nov 21, 2012, 2:39:09 PM11/21/12
to
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)?

--
*****************************
Chuck Anderson • Boulder, CO
http://cycletourist.com
Turn Off, Tune Out, Drop In
*****************************

Beauregard T. Shagnasty

unread,
Nov 21, 2012, 2:51:08 PM11/21/12
to
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)?

Are you perhaps referencing Intellitxt popup "windows"? Do words have a
double underline? Google returns many pages, such as:

<http://uneasysilence.com/2007/03/howto-disable-annoying-intellitxt-links/>

There's also some annoying Facebork stuff I've seen, which is embedded
JavaScript.

For the CSS, you'd have to supply a sample page, say which links, so we
can see what is causing it. Most likely, it would be a title attribute on
the link.

--
-bts
-This space for rent, but the price is high

Ron K.

unread,
Nov 21, 2012, 2:58:51 PM11/21/12
to
Beauregard T. Shagnasty on 11/21/2012 2:51 PM, keyboarded a reply:
For the CSS Hover situation, a generic entry in a userContent.css could
be crafted to hide Hover events. I say generic because such a rule would
apply to all hover events. It should be possible to craft a more
specific rule based on example pages. So give us some help with a link
or two.

--
Ron K.
Who is General Failure, and why is he searching my HDD?
Kernel Restore reported Major Error used BSOD to msg the enemy!
Message has been deleted

J. P. Gilliver (John)

unread,
Nov 21, 2012, 4:57:37 PM11/21/12
to
In message <WfWdnct3hJd0sDDN...@mozilla.org>, Chuck
Anderson <cyclet...@invalid.invalid> writes:
>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)?
>
One of the Adblock add-ons (such as Adblock Plus) will probably do what
you want; and/or, if you can identify where the ad.s are coming from,
adding something to your hosts file could help.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

.. but it's princess Leia in /Star Wars/ who retains the throne in terms of
abiding iconography. Ask any teenage boy, including the grown-up ones.
- Andrew Collins, RT 16-22 April 2011

VanguardLH

unread,
Nov 21, 2012, 7:52:36 PM11/21/12
to
"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).

Chuck Anderson

unread,
Nov 22, 2012, 1:25:36 AM11/22/12
to
Beauregard T. Shagnasty wrote:
> 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)?
>
> Are you perhaps referencing Intellitxt popup "windows"? Do words have a
> double underline? Google returns many pages, such as:
>
> <http://uneasysilence.com/2007/03/howto-disable-annoying-intellitxt-links/>

They don't say how what Firefox Extension to download nor how it does it. I
don't want to merely block the content, as some of the suggestions there do.
I want to eliminate the layer popping up over the content. I already have a
HOSTS file that blocks a lot of ads. I'm just sick of these web pages that
use JavaScript and Css to make things move around, cover content, dim the
whole page.

To be clearer. I wish Firefox's JavaScript options (Tools Options - Content)
had a finer controls. Like blocking onMouseover events except for sites on a
white list. This is how I use YesScript as opposed to NoScript. I know I can
stop sites from changing the status bar, or replacing the context menu. I'd
like also to be able to select "block onMouseover," and with a white list to
be the best.

> There's also some annoying Facebork stuff I've seen, which is embedded
> JavaScript.
>
> For the CSS, you'd have to supply a sample page, say which links, so we
> can see what is causing it. Most likely, it would be a title attribute on
> the link.

No specific instance is needed. In css you can define a separate style for
DOM objects when the cursor hovers over them. This is one more way (the way I
prefer in my designs as it does not require JavaScript) to pop up needed
information.

.selector1 {text-decoration: underline, color: blue;}
.selector1 span {(display: none}
.selector1:hover span {display: block}

Now whatever content is in a span within the block with class=selector1 will
be invisible until the cursor hovers over the object with class=selector1.

It would be nice if you could disable the css :hover actions, ... and again, a
white list would be a nice option.

Chuck Anderson

unread,
Nov 22, 2012, 1:34:01 AM11/22/12
to
What generic rule in userContent.css will block :hover actions?

And to be honest, I don't have any specific sites. It seems these days that
many sites are literally infected with these annoying tricks. I often click
my YesScript icon and block all JavaScript on those sites. I haven't
investigated enough to know what sites uses css :hover, ... just wondering if
there is a an extension or other method (userContent.css) to block :hover
actions. Perhaps blocking :hover on any tag except anchor tags (where most
people are used to seeing links change when you hover over them).

These are the "new" Web2.0 popups and it seems browsers should be trying to
defeat them as handily as they have defeated Javascript being able to
automatically pop up up new windows.

Chuck Anderson

unread,
Nov 22, 2012, 1:37:59 AM11/22/12
to
Sailfish wrote:
> My bloviated meandering follows what Chuck Anderson graced us with on
> 11/21/2012 11:39 AM:
>> 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)?
>>
> Can you provide a test link for each case that you want to inhibit the
> popup? It's unclear what you mean by CSS hover popups, for example.
>

See my first reply to Mr. Shagnasty. It's a simple css tool, adding :hover to
a selector (class) definition that makes a DOM object visible when it's parent
is hovered over. Is there a method or extension that would allow me to
selectively disable certain aspects of css - and more generically than
specifically?

Chuck Anderson

unread,
Nov 22, 2012, 1:39:15 AM11/22/12
to
J. P. Gilliver (John) wrote:
> In message <WfWdnct3hJd0sDDN...@mozilla.org>, Chuck
> Anderson <cyclet...@invalid.invalid> writes:
>> 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)?
>>
> One of the Adblock add-ons (such as Adblock Plus) will probably do what
> you want; and/or, if you can identify where the ad.s are coming from,
> adding something to your hosts file could help.

I've already got all that going. But I still get a window that blocks
content, it just says Not Found, instead of displaying the intended content.

Chuck Anderson

unread,
Nov 22, 2012, 1:42:36 AM11/22/12
to
I'd rather not have to click a second bookmark.

> 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.

Or it opens a simple DOM object like a div.

>
> 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).

I don't want to simply block the ad content. I want to stop the trigger that
displays the "popup" with or without the ad content.

Ron K.

unread,
Nov 22, 2012, 1:55:49 AM11/22/12
to
Chuck Anderson on 11/22/2012 1:25 AM, keyboarded a reply:
What I was thinking of is
p:hover {display: none}
kind of rules in a userContent.css in the profiles Chrome folder.
Message has been deleted

VanguardLH

unread,
Nov 22, 2012, 11:43:40 AM11/22/12
to
To stop the trigger means stopping whatever enables the trigger
(Javascript) or redefining the trigger (nullify it by running your own
Javascript). If you want to go through the trouble of defining an
add-on just so you can have a button on a toolbar to click when the
problem appears or to always redefine these events (probably not a smart
thing to do) go right ahead. A bookmark defined to run a Javascript
(aka bookmarklet) seemed an easy way to accomplish the task of
redefining the trigger.

In other subthreads, you were thinking of disabling the hover event.
That means it will be disabled (redefined) in ALL web pages, including
those where the hover provides functionality that is required to use the
page or to navigate to other pages, not just the pages you happen not to
like the effect. For example, I've visited web pages that had a navbar
(within a frame). When you hover over each topic, a drop-down appears
to get you to other pages. There is no other means of finding those
other web pages using controls provided by the site. There is no "site
map" page so you can find those other pages (and many site map pages are
incomplete, anyway). Sometimes the designer will let you click on the
topic in the navbar to get you to an overview page with the links to the
other pages but not always. The topic is just a text object with the
onmouseover event on it and that object itself is not clickable, so you
must use the hover event to popup a list of the other pages to get to
those other pages. Yeah, it's an incomplete navbar but that's what they
gave you to use for navigation around their site. Disabling the hover
event means you'd never be able to navigate around such sites.

If you don't want to use the Bookmarks toolbar to show the Javascript
bookmark or have to load the bookmarks in the sidebar, add a keyword to
that bookmark. Then you can just enter the keyword in the address bar
which is always present.

https://groups.google.com/group/mozilla.support.firefox/browse_frm/thread/cef220fef3493148
http://en.wikipedia.org/wiki/Features_of_Firefox#Smart_Bookmarks

If even that is too hard, and since you don't want to kill the in-page
popups using an ad blocker, then you're stuck disabling Javascript. Of
course, you don't have to disable Javascript in Firefox but just use the
NoScript add-on.

You could go to http://support.mozilla.org/en-US/products/firefox?as=u
and use the Suggest Box to submit an RFE (request for enhancement) but
that won't help you now. You could submit an RFE that ask for more
options in defining Javascript in Firefox (Options -> Content ->
Javascript -> Advanced). There they could add Javascript methods,
including the onmouse* stuff, and you enter what you want it to do from
a drop-down list (null, some common replacement function, or a blank
entry where you enter your own code). A separate whitelist would let
you define URLs where you did NOT want those replacements to be enforced
(i.e., where you don't want Firefox to receive the document and make
Javascript replacements). However, it seems Firefox would be doing much
of what the NoScript add-on does now. NoScript has its own whitelist of
where it does NOT automatically block scripts. If you think Firefox
will be too slow to implement this level of granularity in on-the-fly
modifying Javascript then maybe the author(s) at NoScript might listen.

Chuck Anderson

unread,
Nov 24, 2012, 7:46:54 PM11/24/12
to
Combining css rules like that with a white list (or black list) may produce
desirable results, but I'd have to get into the internals to accomplish that.

Sailfish posted a link to the "add-on builder API" some time back -
https://addons.mozilla.org/en-US/developers/builder - and that did get my
attention. Maybe this would be a good way to give that a test run.
0 new messages