26 comments

[ 2.5 ms ] story [ 62.8 ms ] thread
Awesome I always wanted something like this and didn't make the connection it would be that obvious to do. Thanks! You are going to make my life nicer
Honestly, a right-click option for "copy naked/root/plain domain" instead of copying the entire address with protocol would make sense for almost browser; they all ship with developer tools pre-installed.

Control click, shift+ctrl+c would work, there are many ways to do this.

Thanks for the tip but I don't seem to have this option on Chromium based browsers on macOS.
"Copy text that is highlighted to the clipboard" is a paradigm that has existed for 40 years until we-know-better Google decided to break it.
I've got several Bash aliases that are "wrappers" around functions like that and which help "fix" commands / find common mistakes.

The one thing to keep in mind while doing that is that you should not modify how a command behaves in the happy case and your wrapper should only be used when using the shell yourself. Do not wrap commands and then use the wrapper from shell scripts, for example. Otherwise you'll be sorry out of luck if you copy your script to another script.

Sounds interesting, do you have a repo with your fixes somewhere?
I agree.

But on the flip side if you only use functions you can't use them in xargs, parallel etc.

So I often so use my own wrapper scripts in a dir in front of PATH and I pay the price of occasionally sharing bad scripts with my coworkers. Most of the time those broken scripts are caught by CI but not all scripts are...

I know that technically I could wrap /bin/sh /bin/bash with a wrapper that strips my wrapper dir from PATH but that's too invasive and I don't want to do that.

I wonder if there is a trick? Perhaps some pre-run hook that one can register in some advanced shells (e.g. I actually use zsh)?

> Modern browsers, believing they are being clever, hide the protocol in the URL bar.

Not all, thankfully. Safari doesn't do this.

Wasn't safari the first browser to "simplify" the URL?
System16 is correct; you can select a part of the domain, and Safari will not alter it when you copy the string to the clipboard.
(comment deleted)
stupid question: why do you want to find the ping from the browser tab?
Can't load site on the browser, so I want to ping the server to see if it's up.
I kinda wish the browsers error page would do this.

I want it to give a brief summary of:

* Was the TCP connection established.

* Was an ICMP error sent back (ie. Connection refused)

* Is the host pingable

* Is any other host pingable.

* Does the local machine have an IP address.

* What did the DNS response look like.

Etc.

Obviously all that lot should probably be under a 'stats for nerds' title.

Yup, see if a server is up or get the IP to determine the hosting provider.
No. No, no, no, a thousand times no.

We shouldn't come up with workarounds for Google's shitty software. It enables them in furtherance of their goal of wrecking the Internet beyond recognition. The solution is to file a bug report and get them to fix their broken software. They have a monopoly, way too much money, and developers who need to justify their existence so they come up with these ridiculous "improvements" no one asked for.

The clipboard bug is just one thing wrong with the picture; the trimming of the protocol and the asinine "tune" icon which replaces the lock (which thankfully Safari and Edge have refused to follow this trend, with MS having to patch out this nonsense from the tree because they understand their customers aren't insane). Present-day Chrome is as if "The Homer" car was a web browser.

Enough of the avant-garde crap; I wish Google would just go away. They are the obnoxious rich kid in the room and have overstayed their welcome.

I don't think you're stripping the userinfo quite right. You're stripping everything after the at-sign, when you want to strip what's before:

  scheme://user:password@some.host:port/path?query_key=query_value&another_key=another_value#fragment
Doesn't chrome remove the user info (or at least the password part) from the URL?

(On mobile now cannot check)

EDIT: check: it does it only after successful access. If the browser still presents the basic auth window because the backend responds unauthorized then copy&paste data will contain the full userinfo

Seems like an excellent use case for trurl [1], a tool built on curls url parsing functions (which can presumably handle any weird url format you throw at it), though I'm not sure how well packaged/available it is.

[1]: https://github.com/curl/trurl

Make more noise about bad UI design.

As far as I'm concerned, this particular behaviour is a product of an incorrectly designed user interface. Within the Windows-style clipboard paradigm, pressing 'copy' in a text field has always been a command saying "copy my selection to the clipboard". The program ignores half of this command and acts in a surprising way.

In this particular case a fair bit of noise was made when it was introduced; namely - the UI hiding the URI scheme. It started in Chrome.

https://superuser.com/questions/1356867/chrome-69-hiding-www...

All the noise was summarily ignored, “because we know better”.

We need more browser diversity.

We have more browser diversity. Use Firefox.
I use Firefox since the time it was Netscape Navigator 2.0.

Unfortunately that’s not the case for almost 70% of the others. Thus de-facto there is no browser diversity.

The only saving grace for me as a user is majority of the things possible are already standardized, so there is a relatively small vendor lock-in surface, thus I am not quite forced to switch to chrom.*

My comment was mostly aimed to other people (I suspected you might be using Firefox).
Nice work. Drives me nuts that you have to strip off the protocol. I get the logic but UX is better if you allow it. We are in a REST all the things universe now.