Clever web dev trick for checking browser history
Sniff browser history for improved user experience
Talk about sufficiently advanced technology. Although you will surely see this post linked many times this week, I have to throw in my own kudos. Fantastic trick, Niall!
In a nutshell, Niall shows how you can use a combination of CSS and JavaScript to selectively display information based on previously visited URLs in your visitor’s browser history. Have you been to Digg? Then Niall’s site displays a “Digg This” badge (and, importantly for Niall’s purposes, not 100 other badges for sites you haven’t used).
Try Niall’s live example to see this stunner in action.
Dang. That sound you just heard? That’s a few million people scurrying to hit “Clear History.” Terrific work, Niall – totally clever.
Now, regrettably, I suspect the race begins for seeing how horribly something like this can be abused.
- Merlin's blog
- 23817 reads
Fortunately, it's easy to break
Fortunately, for those of us who think this crosses the line on privacy, breaking every test case on the site only takes one line in a user.css file:
a:visited {color:blue !important}And yes, that line has already been loaded into Safari on my system, and it's going to stay there. Although I admire the cleverness of the programming Niall used, I don't appreciate exposing my browsing history to random websites through unexpected methods. Niall's approach breaks the principle of least surprise, and it plays fast and loose with what most users would consider private data - I can't see how implementing this technique in the real world could be seen as a good idea. Just because you can doesn't mean that you should.