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