it's Y! time again
Friday, 20. April 2007, 21:44:17
The Yahoo mail Beta blog informs us that they are rolling out a new update. Sure enough, the code has had a makeover and one of their bright new features is the following line (which I'll wrap for your reading pleasure):
if ( navigator.product != 'Gecko' ){
document.styleSheets[0].cssText = cssContents;
} else {
var cssTag = document.getElementById('css_place_holder');
cssTag.innerHTML = cssContents;
}
Guess what? Opera isn't Gecko.
Guess what? Opera doesn't support CSSStyleSheet.cssText.
Guess what that adds up to? No CSS for you, Sir - the whole Y!Mail beta turns into an ugly, unstyled mess where no buttons or options are where they are meant to be. (Since this update is still being rolled out, you may not see it on your account yet but at least one of our test accounts gets the new code with this problem.)
If you'll excuse a bit of screaming..
I just hate this "there are only two browsers" mindset.
This sort of quick and lazy assumptions cause the worst compatibility problems across the web. And just look how incredibly simple it is to do it in a better way:
if ( typeof document.styleSheets[0].cssText != 'undefined' ){
document.styleSheets[0].cssText = cssContents;
} else {
var cssTag = document.getElementById('css_place_holder');
cssTag.innerHTML = cssContents;
}
So what part of "avoid browser sniffing" do the Y!Mail developers not understand?








shoust # 20. April 2007, 23:08
Eddie_Lopez # 21. April 2007, 00:10
How embarrasing is it for me to tell my friends: "Opera signed a deal with Yahoo! to enhance the mobile search experience..." only to hear them say "too bad Yahoo! mail doesn't work with Opera...."
hallvors # 21. April 2007, 00:22
xErath # 21. April 2007, 00:54
dantesoft # 21. April 2007, 06:42
Maulkin # 21. April 2007, 17:08
hallvors # 21. April 2007, 21:14
dantesoft # 22. April 2007, 07:21
As per the documentation (which ironically isn't very up-to-date), you can manually get the browser.js file ASAP: Help > Check for updates. I wish there was a feed
hallvors # 23. April 2007, 11:26
dantesoft # 23. April 2007, 12:01
Originally posted by line #159:
Originally posted by line #431:
And this from the site used by Opera for its Encyclopedia and Dictionary hotclick items. To fix the problem, I use answers_pron.0.1.js (has a 5 seconds timeout ;) Feel free to make a new post of it.dduenker # 23. April 2007, 12:42
"i'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet"
janeythecrazy # 24. April 2007, 05:20
hallvors # 25. April 2007, 14:16
janeythecrazy: yes indeed. And writing code like the stuff I quoted here makes it much harder for them to expand their browser support (I'm sure they intend to support more and more browsers but the more browser sniffing hacks they have used, the harder that is going to be!)
rachel lynn # 26. April 2007, 15:57
rachel lynn # 26. April 2007, 15:58