7 ms·
A little while back I started experimenting with changing the user agent string and found that there are actually many different variations of Google’s search U
by tech234a 7y ago
A little while back I started experimenting with changing the user agent string and found that there are actually many different variations of Google’s search UI that are currently accessible. For example, I was surprised to find that by setting the user agent string to Netscape Navigator 4, I could get a lightweight, no-JS version of Google that looked like it was from the early 2000’s. By using a user agent string from IE6/IE9, I could get a version of Google they looked like it was from around 2010 (the former with a simple white navigation bar, and the latter with a more complex black navigation bar). I found it interesting that these UIs seems to be almost frozen in time: many of their navigation bars contain some outdated links that either redirect or 404. I assume this mean that old browser versions are stuck in time in terms of Google search UI also.
Many of these UIs don’t have the controversial changes that Google has recently been implementing, including adding favicons and hiding full URLs.
I also found that there were several different mobile UIs for Google with different navigation schemes and search box styles.
I implemented what I found in a simple Firefox extension that changes the user agent string for Google searches [1].
[1]: https://addons.mozilla.org/en-US/firefox/addon/google-search-ui-chooser/ https://addons.mozilla.org/en-US/firefox/addon/google-search...
- userbinator 7y agoMany of these UIs don’t have the controversial changes that Google has recently been implementing, including adding favicons and hiding full URLs. I used the UA workaround up until near the end of last year, when they broke it and instead replaced with an even more dumbed-down mobile UI. (If you know of a UA which can still "unlock" the old JS-less full-featured UI, please say so!)
- rasz 7y agoYour post got me excited, sadly it doesnt work :( I installed "User-Agent Switcher for Chrome" and played with strings from this extension. Even verified in dev console "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" was being send, cookies/localstorage deleted. At best what I was able to get is "Second Alternate Mobile UI". I was really hoping for "Last-gen, Black Bar", but it seems unattainable :(
- alessioalex 7y agotry this: Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/7.2.1.0 Safari/536.2+ from: https://news.ycombinator.com/item?id=22114207 https://news.ycombinator.com/item?id=22114207
- tech234a 7y agoI just realized that most of these UIs unfortunately redirect to a simplified mobile UI. Thanks to those who pointed this out in the comments; after Google had left the UIs in-place for 15+ years, I wasn’t expecting them to remove in the few months since I put together this extension. I’ll look into seeing if there are any user agent strings that still work in the future.
- tech234a 7y agoI did a little testing, and found that Google Images still uses the old UI with these user agent strings. I also found another, even simpler mobile UI available with this user agent string, though results seem to be sent through a mobile-formatting proxy operated by Google: Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/7.2.1.0 Safari/536.2+
- Huntro 7y agoThey intentionally show a broken UI if your user agent is Vivaldi. [1] In my opinion this is really concerning. [1]: https://www.youtube.com/watch?v=QkayN3xiRDc https://www.youtube.com/watch?v=QkayN3xiRDc
- tristador 7y agoCrazy. User agent strings are such a broken concept where every browser pretends to be another. How anyone is still attempting to use them to do anything useful is beyond me. If you a building a webapp, use feature detection not user agent strings.
- techslave 7y agoUA is advertisement (heh) of features. Why shouldn’t you use what the browser tells you?
- tristador 7y agoThink about the mapping between features and UA strings. Over time features are added or removed. So those mappings grow stale. Check out feature detection vs browser detection, it explains some of the challenges to relying on user agent strings. I think the rule is: detect features, don't rely on unreliable proxies for features. https://mobile.htmlgoodies.com/html5/client/browser-and-feature-detection-make-your-website-look-great-everywhere..html https://mobile.htmlgoodies.com/html5/client/browser-and-feat...
- mattnewton 7y agoI agree with that advice for most sites, especially SPA's, 100%. But Google search has some weirdly specific requirements. It needs to know if it can show a result that required a polyfill mere ms after it gets your request, for example, or if it would be better to just send less bytes and a scaled down version of the same result that might need different data to assemble. It's not perfect but a UA string is one of the only practical ways to do this. Having qa and engineers to keep track of this mapping for the most commonly used browsers may make sense for search to shave off a bunch of time shipping js and doing feature detection to figure out what it needs next, but may not make sense for your website. In general there are no blanket general guidelines that apply to every single site regardless of usage patterns or business needs. Disclaimer: Former web search eng, current Googler.