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

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.


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


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

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


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.