问题
I would like to know if there is a way to remove the "tooltip" (I don't know if is the right name for that element) that appears at the bottom-left of the screen when I stop the mouse cursor on a link.
I've taken this screenshot from my google search result page. As you can see the first site is underlined because the cursor is on it (you can't see the cursor because when I take a screenshot it disappears). The tooltip I'm talking about is the one at the bottom-left of the screen, surrounded by the smaller red rectangle.
I didn't find information about this element and, onestly, I don't know if I can remove it modifying some browser settings. I'm currently using Firefox and Chrome but I'm looking for a general solution.
Thank you in advance for your help.
回答1:
you could do it in older browsers, which would hide the status bar.
But to switch it off manually you could put this script in page somewhere...it removes href tag attaches onclick event listener...
$("body").on('mouseover', 'a', function (e) {
var $link = $(this),
href = $link.attr('href') || $link.data("href");
$link.off('click.chrome');
$link.on('click.chrome', function () {
window.location.href = href;
})
.attr('data-href', href) //keeps track of the href value
.css({ cursor: 'pointer' })
.removeAttr('href'); // <- this is what stops Chrome to display status bar
});
回答2:
You can replace the anchor tag with a button that when clicked executr a javascript function that links to your requested page
window.location.href = /route
回答3:
Most modern browsers don't allow you to access the status bar to prevent phishing attacks. You can try this javascript but most likely it will be incompatibly with a majority of browsers:
<script language="javascript" type="text/javascript">
function hidestatus(){
window.status='';
return true;
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEDOWN | Event.ONCLICK | Event.MOUSEMOVE | Event.MOUSEUP);
document.onmouseover=hidestatus;
document.onmouseout=hidestatus;
document.onclick =hidestatus;
document.onmousemove=hidestatus;
document.onmouseup=hidestatus;
document.onmousedown =hidestatus
</script>
来源:https://stackoverflow.com/questions/34212385/disable-link-reference-tooltip-in-browsers