Skip to content

Instantly share code, notes, and snippets.

@connormckelvey
Created March 20, 2014 19:30
Show Gist options
  • Save connormckelvey/9671914 to your computer and use it in GitHub Desktop.
Save connormckelvey/9671914 to your computer and use it in GitHub Desktop.
Copy Hostname from Chrome
Simple JS Bookmarket to let you quicly copy just the hostname of a url. Chrome hides http:// in the url which makes it hard to easily copy and paste a hostname. If you use a shell or ftp client a lot you know what I am talking about. Here is the script:
javascript:void(
function(){var u = window.location.hostname.replace(/^www\./,'');
window.prompt('Copy URL to Clipboard CMD/CTRL + C',u);
}()
);
@connormckelvey
Copy link
Author

Copy and paste the function above and add it as a bookmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment