miscoded

the web is a hack

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

postMessage()'s targetOrigin and securitymissing @ping

Comments

Daniel HendrycksDanielHendrycks Saturday, August 7, 2010 2:59:37 AM

When it comes to site patching, does Amazon ever reply?

serious Saturday, August 7, 2010 6:28:45 AM

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

Galileo Saturday, August 7, 2010 7:29:17 AM

Flame it on twitter wink

F.V.F-V Saturday, August 7, 2010 8:14:59 AM

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

Daniel HendrycksDanielHendrycks Saturday, August 7, 2010 4:50:07 PM

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.

Unregistered user Saturday, August 7, 2010 10:28:58 PM

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'.

Hallvord R. M. Steenhallvors Sunday, August 8, 2010 12:09:11 PM

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

Unregistered user Sunday, August 8, 2010 6:02:08 PM

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.

Hallvord R. M. Steenhallvors Sunday, August 8, 2010 11:16:49 PM

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 wink

prd3 Monday, August 9, 2010 9:32:40 AM

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.

Cutting Spoonhellspork Monday, August 9, 2010 10:21:20 PM

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?

d4rkn1ght Tuesday, August 10, 2010 4:15:11 AM

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.

Cutting Spoonhellspork Wednesday, August 11, 2010 4:00:14 AM

/r/ is that way >>

*runs*

(But seriously channers could get it done)

Charles SchlossChas4 Thursday, August 12, 2010 10:49:46 PM

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

Martin RauscherHades32 Saturday, August 14, 2010 6:00:23 PM

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)

Unregistered user Sunday, September 12, 2010 1:56:31 AM

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.html All evidence pointing to Amamzon digging it's heels in and refusing to produce anything vaguely resembling competent. Garrett

Unregistered user Thursday, September 16, 2010 8:47:24 PM

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

Write a comment

New comments have been disabled for this post.