Amazon's surgical server-side sniffing
Saturday, August 7, 2010 1:40:23 AM
var amznJQ = {
_a: [] , _s : [], _d: [], _l: [],
_o: [], _c: [], _cs: [],
addLogical: function() {
this._l.push(arguments)
},
addStyle: function() {
this._s.push( arguments)
},
declareAvailable: function() {
this._d.push(arguments)
},
available: function() {
this._a.push(arguments)
},
onReady: function() {
this._o.push(arguments)
},
onCompletion: function() {
this._c.push(arguments)
},
completedStage: function() {
this._cs.push(arguments)
}
If Opera asks for that page, we get this:
var amznJQ = {
addLogical: function ( ) { },
addStyle: function() { },
declareAvailable: function () {},
available: function() {},
onReady: function() { },
onCompletion: function () {},
completedStage: function() {}[/url]
That can only be described as [i]surgical[/i] browser sniffing: very carefully make sure functions are empty and variables not declared if the browser is not on your list of friends. Hey Amazon, browser sniffing is uncool even though you pretend to be surgeons :(








Daniel HendrycksDanielHendrycks # Saturday, August 7, 2010 2:59:37 AM
serious # Saturday, August 7, 2010 6:28:45 AM
Galileo # Saturday, August 7, 2010 7:29:17 AM
F.V.F-V # Saturday, August 7, 2010 8:14:59 AM
Daniel HendrycksDanielHendrycks # Saturday, August 7, 2010 4:50:07 PM
Originally posted by F.V.:
I opened a thread on that, it was the closed, soon after. Amazon must be paying to have its site on speed dial.
Unregistered user # Saturday, August 7, 2010 10:28:58 PM
Hallvord R. M. Steenhallvors # Sunday, August 8, 2010 12:09:11 PM
Originally posted by anonymous:
Anonymous: you might be confusing sloppy coding and intelligence here. The code Firefox gets and Opera doesn't above is sheer basic ECMAScript and I'm sure all versions of Opera that support JavaScript can handle array literals and array.push().
Unregistered user # Sunday, August 8, 2010 6:02:08 PM
Hallvord R. M. Steenhallvors # Sunday, August 8, 2010 11:16:49 PM
print 'addLogical: function() { '; if(ie) print '...some js...'; else if(gecko) print '...something else?...'; print '}';and we already started bugging Amazon about it a while ago. Don't know how many layers of management we've gotten through so far
prd3 # Monday, August 9, 2010 9:32:40 AM
Originally posted by F-V:
The whiners are out in force today, I notice. Always with the accusations. Always bashing Opera. Have they nothing better to do with their time? Clearly not.
Cutting Spoonhellspork # Monday, August 9, 2010 10:21:20 PM
d4rkn1ght # Tuesday, August 10, 2010 4:15:11 AM
Cutting Spoonhellspork # Wednesday, August 11, 2010 4:00:14 AM
*runs*
(But seriously channers could get it done)
Charles SchlossChas4 # Thursday, August 12, 2010 10:49:46 PM
seems like its time to add a few things to the server logs w/ the refresh every ...
Edit: reload every 5 seconds for about 15 minutes done
Martin RauscherHades32 # Saturday, August 14, 2010 6:00:23 PM
Unregistered user # Sunday, September 12, 2010 1:56:31 AM
Unregistered user # Thursday, September 16, 2010 8:47:24 PM