Post Reply 
stopping onmouseover status bar messages
Aug. 11, 2004, 07:57 PM
Post: #1
 
Hi all,

One thing that really annoys me is when you move your mouse over a link and a message appears in the status bar as opposed to the real url.

Now I suppose the easy way to stop that is by disabling onmouseover, but with so many sites using drop down menus, I didn't want to go that route.

Also using a javascript status function like so:
Code:
function status() {return true}
Has its drawbacks also. The main effect this seems to have is nothing displays in the status bar, no message, no url.

Also I have seen sites that do:
Code:
onmouseover="status='msg';return true"
Which effectively replaces the status function.

As it turns out, if "return true" is used on a mouseover event, it tells the browser to prevent the default action, which for a link, is to show the url. So by eliminating "return true", the real url will be shown.

With that in mind,`here is the filter that I'm now using:
Code:
[Patterns]
Name = "Stop Link Hiding"
Active = TRUE
Bounds = "onmouse(out|over)\s+=$AV(*)"
Limit = 256
Match = "\1return\s*(?)\2(^*?)"
Replace = "\1\2"

This filter just removes the "return" statement. Image swapping & dropdown menus still function but the real url shows in the status bar.

For my filter setup, I placed this near the end & don't need "multi" enabled. Depending on your filters, you may need to enable "multi".

Comments Welcome
Mike
Add Thank You Quote this message in a reply
Aug. 11, 2004, 08:12 PM
Post: #2
 
Looks very good.

I can't think of any way to improve this Eyes Closed Smile
Visit this user's website
Add Thank You Quote this message in a reply
Aug. 11, 2004, 10:03 PM
Post: #3
 
Mike;

Nice, but I've got a few questions.

1) Why do you match on the onmouseout event? When the mouse leaves a link, regardless of any event handler, the default action is already to do nothing. By default, the status bar returns to displaying nothing, or else whatever it should display by virtue of some previous command. (And if the status bar displays undesirable junk all the time, then this isn't the correct filter to be removing that action; but I'm sure you already knew that. <_<)

2) There are other interactive elements that react to mouse events. What about form elements and image maps? To be sure, image maps are really just links of a different nature, but form elements, particularly buttons, are not the same at all. (And don't be limited to thinking of menus here, either.) Here, we depend on javascript for anything above the most rudimentary actions. Messing with a 'return' attribute in these cases can easily mess up part or all of a page.

Like you, I have also seen some strange coding in my time. More than once, I've seen onmouseover events for both the a href.... tag, and the <img.... tag embedded within that link. One had a return, to control the status bar, the other popped up the URL in the "alt" text box. Kinda neat, when you think about it, but highly out of the ordinary. The point being, your filter would break this "feature", but whether or not that's desirable, or even acceptable, is up to the individual viewer.

What I'm driving at is that I think you can improve your filter in two ways - remove the onmouseout event handler from the match string, and enlarge the bounds to specify the <a href..... [/url] tags. Or have I missed something in my reasoning? Wink


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Aug. 11, 2004, 11:34 PM
Post: #4
 
Hi Oddysey,

I included the mouseout for the heck of it. Smile! I've tried it with & without it and haven't noticed a difference.

As for other elements, from what I have observed so far, the only element that seems to need "return true" to display text in the status bar are anchor tags. For example, the following code is not matched, & will display a message in the status bar:

[code]
<td onmouseover="window.proxoStatus='hmm';" onmouseout="window.proxoStatus='';" >
[code]

However, if "return true" is included in the above code, the filter will remove it, but the message is displayed anyway. From this, I gather that there is no default action for "onmouseover" unless it's the anchor tag and hence, no need to specify "return true". Note that the first iteration of this filter matched "return true", but I ran into a few sites that used something like "return display(msg)".

For disabling other status bar text, like shown in the example above, I include this in my start js:

[code]
var proxoStatus="";
[code]

then have proxo replace ".proxoStatus" with ".proxoStatus"

In the end, I suppose it would be "safer" to match only anchor tags. However, I like to live on the edge with my proxo filters and it wouldn't be the first time one of my filters "broke" something!

Anyway, I'll post a modifed version later, in the meantime, try it out.

Thanks for the feedback
Mike
Add Thank You Quote this message in a reply
Aug. 12, 2004, 01:15 AM
Post: #5
 
Ok, as promised, here's the version for matching the anchor tag only

Code:
[Patterns]
Name = "Stop Link Hiding2"
Active = TRUE
Multi = TRUE
Bounds = "<a\s[^>]+>"
Limit = 1024
Match = "(*onmouseover\s+=)\0$AVQ(\1return\s*(?)\2(^*?))(*)\3"
Replace = "\0\1\2\3"

here's a place you can test it real quick: http://www.pageresource.com/jscript/jmouse.htm

I found I had to enable multi for this, since when it matched, one of my other filters failed to kick in. YMMV

Mike
Add Thank You Quote this message in a reply
Aug. 12, 2004, 01:30 AM
Post: #6
 
I made a filter for my personnal use that kills all status bar effects. I don't like little things in the status bar except the URL.

Code:
[Patterns]
Name = "JavaScript Status Bar Effects Killer"
Active = TRUE
Multi = TRUE
Limit = 500
Match = "window.status( |)=( |)*;"

It could probably be better, but it works for what I want it to do.

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Aug. 12, 2004, 03:23 AM
Post: #7
 
Mike;

Nice job! Big Teeth Truly, I prefer to see Proxo do only what it has to do in order to accomplish the mission. Part of the definition of programming elegance is that 'minimalist' mindset.

However you arrived at your conclusions, I concur wholeheartedly. Your filter is now in my filterset, with all due credit. Wink Thanks.

Oh, yeah. About that 'life on the edge' thing. It may be a dirty job, but.... it's sure fun! :P


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Aug. 12, 2004, 06:00 AM
Post: #8
 
I just use Scott's filter (modified to include mouseout) to disable mouseover code. It has no effect on the display of the URL of a link when the cursor is placed over the link. I use a Firefox setting to prevent garbage from being displayed in the status bar.
Add Thank You Quote this message in a reply
Aug. 12, 2004, 11:16 AM
Post: #9
 
Hi all,

Oddysey, I just thought that I would point out that if I don't include the following in my start js:

Quote:For disabling other status bar text, like shown in the example above, I include this in my start js:

[code]
var proxoStatus="";
[code]

then have proxo replace ".status" with ".proxoStatus"

then on the first example link posted here: http://www.pageresource.com/jscript/jmouse.htm
the message gets "stuck" in the status bar when moving the mouse off the link. Usually, this should not be a problem as most of the time, a mouseout event is included to clear the status text. Smile!

Siamesecat, if you disable that setting in firefox that prevents the status bar text from being modified, you will see the problem that I'm talking about. I suppose if you never use another browser then there is probably no need for you to use any proxo filter to disable status bar text. Wink

Mike
Add Thank You Quote this message in a reply
Aug. 12, 2004, 02:47 PM
Post: #10
 
..::Siamesecat::..

I didn't realize that Firefox had a setting builtin. Thanx for the info!

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Aug. 12, 2004, 04:44 PM
Post: #11
 
Mike;
Quote:I just thought that I would point out that if I don't include the following in my start js:

Quote:For disabling other status bar text, like shown in the example above, I include this in my start js:

[code]
var proxoStatus="";
[code]

then have proxo replace ".status" with ".proxoStatus"
......
Thanks, I hadn't missed that, but truth to tell, I also haven't yet come come across a site that has misbehaved in that fashion. Maybe I'll stick the added line in my file, too, but then I'd always be wondering "Is this thing working, or is it even necessary for the site I'm on?" :o [unsure] Big Teeth

Thanks again.


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: