Foxfix
Sunday, 12. August 2007, 01:51:25
I come back from vacation to a piece of good news: the Foxnews video player works in Opera again. Thanks, David!
The issue that broke Foxnews was so weird that I've analysed it two or three times to be sure. On the face of it, the error was very obvious: the JavaScript console reports that the script tried to use an undefined variable. The hard question was: where was this variable supposed to be defined, and why wasn't it defined in Opera?
It turned out that not just one but a few undefined variables were meant to control the playback of adverts before and after the video contents, and these variables were only set by a certain script sent from the DoubleClick advertising server, and only read by the script embedding the video player. It seemed like DoubleClick had some sort of "bad browser, good browser" logic somewhere, so rather than send us the essential variables they sent a script that just added an old-fashioned ad to the page. I spent quite some time trying to guess the logic - was it user-agent sniffing or something else? - but couldn't quite get to the bottom of it. URLs for most ad-scripts are so hideously complex with tons of parameters - and any parameter, header or cookie might be the cause Opera received the wrong code. I still don't know exactly what caused it..
Browser.js patching appeared impossible, since the patch would have had to guess correct URLs for the video ads meant to run before and after the news.
I was wondering for a while why Foxnews did this. Why on earth make core functionality on your website depend on some random third-party ad server code? Finally the penny dropped: this must be an anti-ad-blocker architecture. If you block scripts from DoubleClick to avoid seeing adverts, the video player won't work..
The issue that broke Foxnews was so weird that I've analysed it two or three times to be sure. On the face of it, the error was very obvious: the JavaScript console reports that the script tried to use an undefined variable. The hard question was: where was this variable supposed to be defined, and why wasn't it defined in Opera?
It turned out that not just one but a few undefined variables were meant to control the playback of adverts before and after the video contents, and these variables were only set by a certain script sent from the DoubleClick advertising server, and only read by the script embedding the video player. It seemed like DoubleClick had some sort of "bad browser, good browser" logic somewhere, so rather than send us the essential variables they sent a script that just added an old-fashioned ad to the page. I spent quite some time trying to guess the logic - was it user-agent sniffing or something else? - but couldn't quite get to the bottom of it. URLs for most ad-scripts are so hideously complex with tons of parameters - and any parameter, header or cookie might be the cause Opera received the wrong code. I still don't know exactly what caused it..
Browser.js patching appeared impossible, since the patch would have had to guess correct URLs for the video ads meant to run before and after the news.
I was wondering for a while why Foxnews did this. Why on earth make core functionality on your website depend on some random third-party ad server code? Finally the penny dropped: this must be an anti-ad-blocker architecture. If you block scripts from DoubleClick to avoid seeing adverts, the video player won't work..