PDA

View Full Version : How to change URL on address bar when clicked on the address bar?



XPMai
04-05-2014, 08:13 PM
Hello,

I am wondering how did Dropbox showed fake link on address bar, when clicked showed longer (real) link.

Screenshots:
1273712738

Video:
http://www.mediafire.com/view/vgt53emvg95h5gc/Dropbox%20address%20bar%20changes%20URL%20after%20clicked%20.avi

Regards,
XP

glenngv
04-05-2014, 08:49 PM
That's just an Opera browser feature where the address bar just shows the domain name and then when focused, the full URL is displayed. If you try to use Firefox app on your phone, the address bar will show the document title not the URL and when focused, the full URL is displayed. Browsers have different features.

XPMai
04-05-2014, 09:39 PM
Hi glenngv,

But other sites by default the address bar show full URL, not only when clicked then show. Like this forum thread, it shows the full URL without clicking on the address bar.
For the Dropbox page, it's my first time seeing that happening.

And you're right! On phone, the browser by default do not show full URL because the phone is small, only when pressed then show full. However, on desktop Opera browser address bar always show full URL without needing to click on the address bar.

Best regards,
Mai

glenngv
04-05-2014, 10:12 PM
However, on desktop Opera browser address bar always show full URL without needing to click on the address bar.
That is contradicting to the screenshots and video you posted in the first post.

As I said, Opera has that feature to only display just the domain URL and not the full URL with querystring parameters (if any) until the address bar is clicked. This has nothing to do with Dropbox.

Arbitrator
04-06-2014, 02:18 AM
But other sites by default the address bar show full URL, not only when clicked then show. Like this forum thread, it shows the full URL without clicking on the address bar.
For the Dropbox page, it's my first time seeing that happening.glenngv's explanation isn't quite accurate; Opera hides the protocol, query string, and fragment identifier in URLs until you focus the address bar. Domain, port, and directory information is shown normally.

In case you're not familiar with the terminology: query strings begin with a question mark (?) and are the second-to-last or last part of a URL depending on whether there's a fragment identifier. Query strings are used by a server to determine what to display on a given page. Fragment identifiers begin with a hash mark (#) and are the last part of a URL. Fragment identifiers are used in HTML documents to navigate to a specific part of a page based on a matching id attribute.

I believe the idea with excluding query strings and fragment identifiers is to prevent the address bar from looking cluttered, particularly when long query strings are used. For example, go to https://login.live.com/, log in, and log out to see a particularly ugly URL. (You may not need to log in to see it if you've logged in to a Microsoft account using your browser before.) Alternatively, go to https://www.google.com/, and perform a search.

Prior to Opera 15 (i.e., Opera 12 and earlier), when the browser was basically rebuilt from scratch, there was an option to disable this behavior. As far as I can tell, that option no longer exists. (That's unfortunate because I prefer seeing full-length URLs; I disabled this feature when I used Opera on a regular basis.)