1

It's a constant annoyance that Google Chrome Inserts http(s):// when copying URLs from Chrome. As a network systems engineer, I am constantly copying URLs to network devices from Chrome into PuTTY, another shell or a script or command line. Is there a workaround or fix?

Justin Goldberg
  • 592
  • 1
  • 7
  • 15
  • 3
    But the http(s):// prefix is a normal part of the URL? Could you clarify what you're trying to copy -- the entire URL or only its domain name? – u1686_grawity Jun 27 '19 at 15:07
  • 1
    @grawity if you want to copy just the hostname for `theserver:8080` you select `theserver` and when you paste say after `ping` in a command line you get `ping http://theserver` – hidralisk Jun 27 '19 at 15:14
  • 1
    What is the problem? If you are using something like `curl` in the command line you need that `http(s)://` in there. Maybe you need to edit your question to better explain what you are doing with these URLs in PuTTY? – Giacomo1968 Jun 27 '19 at 15:14
  • 1
    @hidralisk What you describe makes no sense. Coping a URL from Chrome will naturally have `http(s)://`. It’s not as if this stuff is designed to strip that off so `ping` works well. – Giacomo1968 Jun 27 '19 at 15:15
  • @hidralisk Doesn't happen here -- if I don't select 'http://', then I don't get 'http://' copied... In your case, is it that Chromium _hides_ the original 'http://' in the URL bar? (It used to do so while displaying the URL, but IIRC even then it used to behave normally while editing.) – u1686_grawity Jun 27 '19 at 15:18
  • 1
    @JakeGould Chrome hides http:// from the URL edit box. When I select something in **any** edit box, the convention is to get in the clipboard exactly what I selected. For example, if in my previous example I select `theserver:` (note the column), i will get exactly that in the clipboard. But, if i copy the hostname Chrome thinks it knows better and injects http:// in front of the string that goes into the clipboard. – hidralisk Jun 27 '19 at 15:22
  • @hidralisk Chrome—and many other browsers such as Safari and Opera—hide the protocol part of the URL for aesthetic and user experience reasons. This is a very modern change in behavior. I believe that Firefox is the only browser that still reveals the protocol in the URL area of the browser. So there is a UX point to be made here, but in the end I think the issue is browsers hiding the protocol in the URL area (called the “omnibox” due to it’s multiple uses nowadays) not that the protocol gets copied with the URL. – Giacomo1968 Jun 27 '19 at 15:26
  • WOW this is a duplicate: https://superuser.com/questions/503436/how-to-remove-http-adding-in-addressbar-of-google-chrome-firefox – hidralisk Jun 27 '19 at 15:34
  • I did. Thanks.I am constantly copying URLs to **network devices** from Chrome into PuTTY – Justin Goldberg Jun 28 '19 at 12:33

1 Answers1

1

Visit chrome://flags/#omnibox-ui-hide-steady-state-url-scheme and set the experiment "Omnibox UI Hide Steady-State URL Scheme" to "Disabled". This should return the address bar to a more traditional mode, where the scheme prefix is always shown, and copying will grab exactly what was selected.

While you're at it, you can disable all other "hide steady-state etc" experiments (even if they're currently inactive on your system), so that they won't get activated for testing in the future.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966