Similar to bug 625945, we aim to make the URL preview on hover as readable and easy to parse as possible. Making this change would also reinforce that you're staying on the domain you're currently visiting. Proposed behavior: * If you're on http://www.example.com and hover over a link to http://www.example.net, nothing changes. * If you're on http://www.example.com and hover over a link to http://www.example.com/section, the URL preview on hover shows "/section" — stripping away the redundant domain/protocol information. * If you're on http://www.example.com and hover over a link to https://www.example.com/section, we don't strip anything (since you're changing from http to https, even if it's on the same domain) * This bug depends on bug 625945 to be resolved, since we can't strip only the hostname but not the protocol.
Forgot to mention: * If you're on http://www.example.com and hover over a link to http://subdomain.example.com/section, we only strip the protocol, not the subdomain or domain.
Damn it, copy/paste error :P Trying again: * If you're on http://www.example.com and hover over a link to http://subdomain.example.com, we only strip the protocol, not the subdomain or domain.
What should happen when you're on http://www.example.com/ and the link goes to http://www.example.com?
(In reply to comment #3) > What should happen when you're on http://www.example.com/ and the link goes to > http://www.example.com? Good catch. When people enter "www.example.com" in the URL bar, we ask the server for "http://www.example.com/", right? In any case (unless there's some weird issue I can't see here, security or something), those should be equivalent, and probably just show "www.example.com" in the URL bar — showing just "/" would be weird, and be ambiguous. So I guess we have to special-case the root of the site.
For the "same scheme, same domain" case, maybe make it "…/section", i.e. with an ellipsis as a reference to the current domain? (I'll assume yes for the rest of my questions, but don't hold that against them if you decide no). For "http://example.com/path/to/page1.html" -> "http://example.com/path/to/page2.html", do we show "…/path/to/page2.html"? Or "…/page2.html"? For "http://example.com/path/to/page1.html" -> "http://example.com/path/to/sub/page2.html", do we show "…/path/to/sub/page2.html", or "…/sub/page2.html"? N.B. The other way around we shouldn't try to do stuff like "…/../page1.html". I kinda like the relative paths, but for consistency absolute paths might be better. And if we want to go a step further, for "http://example.com/page1.html" -> "http://example.com/page1.html" we could show "current page" (with some special handling for page1.html#target) How susceptible is this to spoofing? E.g. I'm on "http://trickster.com", and link to "http://trickster.com/https://paypal.com/" ("https:" is a valid directory name), we'd see either "/https://paypal.com/" or "…/https://paypal.com/", is that enough to signal it's a path, not a domain?
To partially answer my own question, once we do some sort of greying out of the mostly uninteresting bits of URLs (perhaps accomplished in reverse by emphasizing the scheme and domain name bits), if we apply the same styling to the preview URL, the difference between HTTPS://PAYPAL.COM/ and …/https://paypal.com/ will be a bit more obvious.