How to remove http:// adding in addressbar of google-chrome/firefox?

34

6

Chrome add the http:// when I copy address from addressbar, i often paste the address to console, to ping or ssh, it is possible to copy only hostname from addressbar ? How to switch off that feature in chrome and also in firefox ? I also like solution that will allow to unhide http:// in addressbar, so i can select domain without it.

zb'

Posted 2012-11-09T15:26:31.503

Reputation: 523

Answers

1

Where is the answer? The suggestion with Home button doesn't work anymore.

While reading all not working answers (I don't need host? for what? if people copy url, they need full url..:), I made my own solution. Just click to address bar, then hold "Shift", then click "Right" and "Left", Voila. Then you can "Ctrl"+"C"...

Stack

Posted 2012-11-09T15:26:31.503

Reputation: 26

btw, good idea, – zb' – 2019-12-23T04:22:57.407

18

Bit of a hack as well, however I simply click in the toolbar, press the Home key, press Space, then press Shift+End and Ctrl+C.

So basically, just add a space to the start. Most commands don't even care if you keep the space in the parameters.

Shaun Forsyth

Posted 2012-11-09T15:26:31.503

Reputation: 281

I like this simple fix. – Liam – 2015-09-28T16:25:49.733

2That's the workaround I use. Looking for a fix like the FireFox flag "browser.urlbar.trimURLs;false" but apparently Google knows better us what we should want in a browser. – TecBrat – 2016-06-08T20:11:44.063

Another thing crossed my mind last night, and I tried it this morning. Just click the address (omni) bar hold CTRL tap "XV" (or "AXV" if it does not fully highlight.) and the full URL will appear in the address bar so you can copy whatever you need out of it. – TecBrat – 2016-06-09T13:48:50.340

10

If you want Firefox to permanently show http in the adress bar:

  1. go to about:config
  2. search for the option browser.urlbar.trimURLs
  3. set it to false

I don't use Chrome, but there is this question: Make chrome put http:// in the browser

unor

Posted 2012-11-09T15:26:31.503

Reputation: 2 749

lol this should be added surely – Meetai.com – 2014-06-29T11:31:05.843

8I would kill for that feature in google chrome... – NickSoft – 2013-04-11T15:50:10.857

7

I use the following javascript snippet in Google Chrome to get the hostname and copy it to clipboard. I just tested it in Google Chrome.

You can create a bookmark int the Bookmarks Bar, name it GetHostname and paste the following javascript code into the "URL" part of the bookmark:

javascript:(function(){
    function executeCopy(text) {
        var input = document.createElement('textarea');
        document.body.appendChild(input);
        input.value = text;
        input.select();
        document.execCommand('Copy');
        input.remove();
    }
    executeCopy(window.location.hostname);
})();

oylbin

Posted 2012-11-09T15:26:31.503

Reputation: 71

Nice solution, but input.focus() causes the page to scroll to the bottom. It's unnecessary, at least for me - the text gets copied without it. – EM0 – 2019-07-07T12:50:45.380

fantastic!!! This is a really nice quick fix – Andy – 2020-02-19T10:07:23.377

5

Warning: Total hack response…

If you highlight the left-most character of the domain name, Chrome automatically adds on the http:// because its implicit in the address. If you highlight and copy all but the first character, you don't get that issue (and need to re-add it in the command).

However as hacks go, I find it easier to do the above (highlight, Ctrl+C, terminal, type first char, Ctrl+V) than to remove the http:// myself.

Others may have better solutions.

mikebabcock

Posted 2012-11-09T15:26:31.503

Reputation: 1 019

1I using the same trick, but it ugly, i just found myself today in terrible user environment, so got several questions that i collected last 2-3 years :) – zb' – 2012-11-09T15:42:39.043

1

@eicto: Make a list of links to these questions and open a google chrome issue/feature request: http://support.google.com/chrome/bin/answer.py?hl=en&answer=95315

– NickSoft – 2013-04-11T15:41:43.613

@NickSoft - FWIW, people have been complaining since this was checked in (well over 3 years ago) to no avail, so I'm not sure 1 more will make a difference. It's an interest read, though: https://code.google.com/p/chromium/issues/detail?id=41467

– James Manning – 2013-08-20T03:24:36.147

Yes, I know. However most people do not take actions. One more is not a big deal, but many more is. I guess google measure in %. If most of the people do not complain, then they are ok with it. I guess most people think that they won't make a difference and that's why they don't complain. – NickSoft – 2013-09-04T18:59:49.707

5

This is pretty awful that chrome needs it, but you can use this addon to copy the host by clicking a button: http://chrisiona.com/post/122938597943/hostcopy-google-chrome-extension

Chris Marisic

Posted 2012-11-09T15:26:31.503

Reputation: 1 123

5I wonder how many people have coded a workaround to the problems caused by the chrome dev team removing the protocol from the url bar and putting in the crappy insert-http-when-copying code. They must have absolutely no knowledge of automated testing if they thought this was a good idea. – Underverse – 2016-04-04T02:27:47.273

2@Underverse probably lots. But then again, Google has legendarily bad UX design, so it shouldn't be surprising. – user428517 – 2017-03-16T17:15:30.390