Change URL displayed in Chrome status bar

When I pointed the URL in Chrome, the URL is displayed in the Chrome status bar. In my case, this leads to an ugly javascript link: bla-bla-bla. Is there a way to change the contents of the status bar when I hover over a link?

thanks

+4
source share
6 answers

I am sure that for security reasons this is not possible in any browser. Otherwise, links to phishing sites will become much more difficult to detect, because attackers can simply put the real URL in the status bar, and the dangerous link really leads elsewhere ...

Instead, use the onclick event handler for your hyperlink and put the real, meaningful URL in the href attribute instead of the javascript: link (even if the link is for use only with JavaScript).

+6
source

Although you have chosen your answer, this idea is an alternative.

You can change the href attribute to mouseover to affect what the status bar says and change it to mouseout or click :

 function showNiceLink(el, e) { e = e || event; el.originalHref = el.originalHref || el.href; console.log(e.type); if (/click|out/i.test(e.type)){ el.href = el.originalHref; } else { el.href = "http://Linking..."; } } 
 <a href="#this is a really UGLY link @1##$$%!!&" onmouseover="showNiceLink(this,event)" onmouseout="showNiceLink(this,event)" onclick="showNiceLink(this,event)">a link with an ugly <code>href</code></a> 
+10
source
 <a href="#" onClick="yourFunc(); return false;">Your "link"</a> 
+1
source

I assume you want to change which destination is shown for the selected link? In this case, you most likely should put a good url in the href attribute and use the onclick attribute for your javascript. Not sure if you can duplicate everything that is done if you put javascritp in href.

0
source

Assuming this is what you have:
<a onClick="blabla">Link</a>
Add href="#" to it. Then instead of javascript:blabla should display # .
So it will be like this:
<a href="#" onClick="blabla">Link</a>

0
source

Definitely you can achieve the desired effect. Just look at what Google puts in the status bar of its search results.

However, you need to use some kind of trick, for example. onclick as suggested by BoltClock.

Google shows you what you would like to see โ€” a simple, clean URL. Below them, however, they use a long redirect URL with monitoring options to track you when you click any link to the result. In this way, Google tracks which of the search results are clicked and which are not.

Unfortunately, most people do not understand this. Honestly, I would be very happy to see a browser extension that removes all these dirty tricks and replaces the "tracking" URLs with "real" ones.

0
source

All Articles