Amazon’s surgical server-side sniffing

This is an excerpt of what Firefox gets when loading Amazon music sampler:

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 :(

17 thoughts on “Amazon’s surgical server-side sniffing

  1. seriously, such behaviour sucks. where can we flame amazon for that? I only found an option where you have to register to give feedback.

  2. And there you are, forcing an Amazon speed dial into the faces of everyone who installs Opera yet their services won't work. Conflicts of interest are interesting for sure, if money is involved…

  3. Originally posted by F.V.:

    And there you are, forcing an Amazon speed dial into the faces of everyone who installs Opera yet their services won't work. Conflicts of interest are interesting for sure, if money is involved…

    I opened a thread on that, it was the closed, soon after. Amazon must be paying to have its site on speed dial.

  4. Anonymous writes:one way of finding why is that is:check when opera introduced features that this part of code uses/fixed some critical bug/incompatibility.push seems to be quite standards thing, but to be frank i stopped checking what opera can do around version 8.x (and never started again – with no devtools from opera i had no incentive to, and given that tools still arent there.. (DF sux))opera did not support setter/getters until recently (9.5?) and most pages once they realise that opera does not support something never will re-check and relegate opera to 'browsers that we dont care'.

  5. Originally posted by anonymous:

    check when opera introduced features that this part of code uses

    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().

  6. Anonymous writes:i simply know that people do not do this without a reason (yes, sometimes reasons are VERY STUPID). forking a code for a gigantic website costs money, money that has to have a reson to be spent. and from my experience as someone who spent this money: if a browser is ONCE decided that it 'doesnt cut it' it is almost never re-checked and given another chance. ERGO: someone at amazon once found out that opera CANT for some reason handle this code (or code that this one depends on) and since then opera is treated as a 'little browser that couldnt'. it is simple. it is a price paid for past mistakes, unfortunatelly. btw. good luck making amazon fix it, 10 layers of management ahead of you.

  7. Naturally it might have to do with code that depends on this code. Since I obviously haven't seen the backend I can only guess but my first guess would be mistakes along the lines of

    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 😉

  8. Originally posted by F-V:

    And there you are, forcing an Amazon speed dial into the faces of everyone who installs Opera yet their services won't work. Conflicts of interest are interesting for sure, if money is involved…

    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.

  9. Could even be that something is broken on their end. I've seen this happen a few times where server-side script fails to populate a script form. Has anyone played with browser masking, found anything that actually doesn't work?

  10. I'm getting tire of all these web sites that use browser sniffing to block browsers that can actually work with the site. There should be away to mass mail these people, and show them that Opera can actually do what they want.

  11. :faint: 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 :angel: (also my flash blockers kicked in hmmm…)

  12. This has been like this for YEARS on Amazon.de … It's down-right stupid… And the problem is: You can't sitepatch it. Because the rest of the page is different, too. (But they don't get rid of ALL the code that uses that object… So it just shows again that only stupid)

  13. Anonymous writes:Amazon book previews have been failing in Opera for years. It is Amazonian incompetence at hand."Your web browser does not support this feature. Please visit our Frequently Asked Questions for a list of compatible web browsers that support the Amazon Online Reader"Doesn't work in Firefox with a modified UA string.Throws "Object Expected" Errors in MSIE 8 (using default settings).They there's this:""use strict"; prepended blindly to scripts in the wild"https://mail.mozilla.org/pipermail/es-discuss/2010-September/011769.htmlAll evidence pointing to Amamzon digging it's heels in and refusing to produce anything vaguely resembling competent.Garrett

  14. Anonymous writes:I get this error in all other browsers as well: IE 8/ FF 3.6 / Chrome on Windows Vista. I wish one of them worked for me 😦

Leave a reply to d4rkn1ght Cancel reply