Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove / move the Google Chrome bottom left status bar (link address bar)

I am working on a website which is designed with a key navigation element in the lower left corner. Within Google Chrome there is a status bar on the lower left which appears when you roll over a link on the page and displays the URL of the page. Though if you get close enough this moves to the lower right. This is getting in the way of this navigation element.

My question is can this be removed / moved (lower right) using CSS, HTML or JavaScript? Please see some notes below.

  • Ideally I would like to move this to the right permanently.
  • I am aware this is required / best practice for many reasons so I would like to avoid removing.
  • I am aware I can remove the href from the link and use an onClick event, this might be a possible workaround but moving right would be a better solution in this instance.
  • I am also sure there is a large debate to be had to about having this navigation element lower left anyway, but I am looking for a solution within the parameters I have to work with.

Thanks

like image 548
alexmcfarlane Avatar asked May 22 '14 07:05

alexmcfarlane


People also ask

How do I remove links from my address bar Chrome?

At the end of the suggested URL, you will see an 'x' mark, as seen in the image below. Click on it. The URL will now disappear from the suggestions. Alternatively, when you see the suggestions, highlight the suggested URL you want to delete with arrow keys on your keyboard and press SHIFT + DELETE keys.

How do I make the URL bar disappear?

You can hide the address bar by entering Full Screen mode. This will only work for one webpage at a time. On Windows, use the F11 key to toggle Full Screen mode. On Mac, use Command + Control + F.


2 Answers

Chrome reads the HREF attribute from your link to display the link in the status bar.

So if you remove the HREF from your A tags, the status bar will not be displayed. However the link won't work either, :). That's why you can create an event handler on MouseOver to address that and keep your links working.

$("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
});

You might run in extra issues, like disabled links or links that have other event handlers. In this case, you can tweak your selector to 'a:not(.disabled)' or perhaps just add this delegation to known elements with the css class ".disable-status", therefore your selector would be: "a.disable-status".

like image 166
ThiagoPXP Avatar answered Oct 22 '22 00:10

ThiagoPXP


As you can see from this screenshot, it seems that Chrome moves the status bar outside the extent of the window when you roll-over a link that is on the edge (the "add comment" link in this instance).

So... I wouldn't worry about it. It's built in browser behaviour, so it's going to be very hard to alter. Once upon a time you could use javascript to modify the content of the status bar, but the browser vendors put a stop to this for all sorts of security reasons.

Don't be tempted down the onclick bodge. You will lose accessibility, and the html demons will haunt your every sleeping moment.

In fact, you could think of this all as desirable behaviour: your navigation and the status are right next to each other, making it very easy for the user to make the right navigation choice (assuming your URLs are user friendly).

Screenshot of described behaviour

tl/dr: Don't.

like image 27
graphicdivine Avatar answered Oct 21 '22 22:10

graphicdivine