Protocol ambiguity in browser links "~/" leads to "~/~/" or /home/nemo/~/
tldr; "Some addressing standards are meant to be unbroken."
"No they're not."
To use a specific directory in an HTML document, use<base href="PATH_TO_PARENT_DIRECTORY/">
(see developer.mozilla.org/.../base. The tilde does not resolve in the browser to $HOME, only in some shells.
Original post:
A link in a local plaintext file is <a href="~/todo">~/todo</a>
.
As a recovering konqueror user, I thought it would lead to file:///home/nemo/todo
.
Instead, it tries to show file:///home/nemo/~/todo
, which does not exist.
Please consider making the browser's treatment of $HOME, or~/
like bash and enable bookmarks to show and handle links like ~/path/to/file
and not only /home/nemo/path/to/file
. It would helpful to not have to prefix with /home/nemo/
. The regular expressions: /^~\//
or /^~/
.
Interpreting the tilde at the beginning of a location or in href
or src
attributes could make bookmarks easier to manage on mobile device-sized screens, in a similar way to how /^./
and /^../
let users avoid writing or reading the whole path to the working directory and its parent. If files get moved around more than a little this can be quite important.
In this narrow use case I think this would work.
- Further reading: http://en.m.wikipedia.org/wiki/URL_normalization
- Screenshot of the relevant part:
What's that with attaching mysterious unrelared screenshots to all your posts? It makes it very hard to read them.
pichlo ( 2015-01-18 13:02:12 +0200 )editSince in-browser text copy and paste are how they are right now, it was easier to take the screenshot. The page was http://en.m.wikipedia.org/wiki/URL_normalization and the shot section talked about the tilde. I gather that this looks less useful outside a small screen. On my phone it looks fine.
rdmo ( 2015-01-18 13:38:34 +0200 )edit