Posted by Rob | Posted in BBC, Browsers, Javascript, Opera, Work | Posted on 13-09-2011
Tags: Hacks, LinkedIn, Opera
I work for the BBC and we work very hard to make sure anything that the public see is of the highest standard, and we’re always working to improve that methodology over time. Yes, like any live and evolving website, the occasional bug does slip through the net. We do our very best to prevent it, having a dedicated team of User Experience and Functionality testers, along side a team of people writing automated tests and software. But bugs can occasionally happen.
When we do find a bug, especially with a new feature, we identify and fix the problem as quickly as possible. This is where I come in. As a developer, part of my job is to do the finding and fixing.
So I was handed a bug to look at. The video was not appearing for some Opera users. I talked over the situation with our QA manager, and discussed just how long the fix should take, how we’re going to roll it out and what impact it will have on users until then.
That having been sorted, I started work on my side of the problem. When I finished, I found my fix only served to create another problem. And another appeared. And another, and another.
By chance, I switched off a setting called “Browser JavaScript”. Suddenly, everything starts working. I just sat there stunned. “What just happened?” I started asking myself. I switch Browser JS back on, and it breaks again. So I started running around the office looking for anyone with Opera to test out this problem.
I found that roughly 50% of users are seeing the same results as I was. The other 50% haven’t got a problem.
So I start reading up about browser JS and start having a look at the file directly. Lo and behold, there is a direct mention of BBC iPlayer. They’re rewriting a core browser JS function. “What the hell?”, you could rightly ask.
} else if(hostname.indexOf('bbc.co.uk')>-1 && pathname.indexOf('/iplayer')>-1){ // PATCH-426, Add to favourites fails on BBC iPlayer because of script loading/parsing timing issue
document.getElementsByTagName=function(n){
var elms=getElementsByTagName.call(this, n);
if(elms.length==0 && n=='body')return [document.documentElement];
return elms;
}
if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Add to favourites fails on BBC iPlayer because of script loading/parsing timing issue). See browser.js for details');
They’re rewriting a core function, built into the browser, and it’s worth noting that this isn’t a problem with iPlayer that they’re fixing. It’s a problem with Opera that they’re working around for only iPlayer.
I did a little research and found this blog, my.opera.com/core/blog/show.dml/3130540 (Update: Can anyone tell me why this only loads in Opera?) from Opera, stating:
“Opera has more experience with site-specific patches than other browser vendors, since we’ve been patching the web since Opera 8.01. I believe our solution is also by far the most advanced one”.
Did I just read that right? Opera are better at developing websites that anyone? That’s an unbelievable statement to make.
What about GreaseMonkey, you might ask. GreaseMonkey is a great little tool for letting users add functionality to websites that they think is missing. Opera are taking that idea and forcing it onto their users by default. It’s not even opt in.
Conclusion: I’ve met some of the Opera people before today. Bruce Lawson is a particularly fine chap. Which is why I’m confused why they would think that as a software development company, not only do they know web development better than web developers, but that they have a duty to edit those sites which fail in their browser. The correct course of action, for me, would have been to contact us directly and report the issue. I just hope they do this in future.
Update: We got an apology my.opera.com/sitepatching/blog/2011/09/12/why-we-broke-2 from Opera which was extremely nice of them.
Update: The apology managed to get to #10 on Hacker news




I'm a 26 year old 





