Skip navigation.

exploreopera

| Help

Sign up | Help

it's Y! time again

,

Yep, it's Y!Mail time again. Warning: this might turn into a rant..

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?

can you help exercise the compatibility skeleton?silver light or darkness?

Comments

avatar
So easy yet so they are so lazy. I'm guessing they have never heard of the QuirksMode site.

By shoust, # 20. April 2007, 23:08:00

avatar
I understand we're talking about big, international companies like Yahoo! and Opera, but why do you guys announce one month that Yahoo! and Opera have an agreement to work together, and the next month you're getting stiffed by them? I don't work for Yahoo!, but *I'm* aware of the OneSearch/Mini deal, why hasn't the person(s) in charge of browser sniffing css for Yahoo! heard about it?

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

By Eddie_Lopez, # 21. April 2007, 00:10:03

avatar
Well, it would be nice if having some sort of contract with a company meant that all their web products would be obliged to work in Opera.. The obvious answer to the "why" question is that there are different teams involved.

By hallvors, # 21. April 2007, 00:22:17

avatar
Think positive. It's just a line of code to add to browser.js

By xErath, # 21. April 2007, 00:54:34

avatar
/me now looks at browser.js and pictures screaming Hallvord typing calmly :smile:

By dantesoft, # 21. April 2007, 06:42:53

avatar
By the way, does the browser.js update itself automatically?

By Maulkin, # 21. April 2007, 17:08:37

avatar
Yes, under normal circumstances browser.js is downloaded automatically. I first need to get a file with the new patch out though, and it will probably not go live until Monday when server admin is working. Then it will take a week or so until all Opera installations have checked for updates and fetched the new patch.

By hallvors, # 21. April 2007, 21:14:46

avatar
opera:config#UserPrefs|BrowserJavaScript: 0=don't use, 2=use and update weekly

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

By dantesoft, # 22. April 2007, 07:21:05

avatar
Patch is live. I also asked webmaster to update opera.com/docs/browserjs/ for Dan ;-)

By hallvors, # 23. April 2007, 11:26:15

avatar
Excellent. Not to hijack the thread, but if you'd now care to check the progress of my answers.com bug report... The pages (e.g. http://www.answers.com/error?nafid=3 ) contain the following wonderful code (which means that sometimes clicking on "pronunciation" works, often times it doesn't):

Originally posted by line #159:


<bgsound id="bgs"></bgsound>
<iframe style="height:1px;width:1px;position:absolute;" frameborder="0" id="soundFrame"></iframe>
<script type="text/javascript">

</script>

Originally posted by line #431:


<bgsound id="bgs_sb"></bgsound>
<iframe style="height:1px;width:1px;position:absolute;" frameborder="0" id="soundFrame"></iframe>
<script type="text/javascript">

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

By dantesoft, # 23. April 2007, 12:01:50

avatar
To quote something funny:
"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"

By dduenker, # 23. April 2007, 12:42:56

avatar
I'm not trying to be a fangirl or an Opera hater, but I think it's equally as stupid that when I log into mail.yahoo.com I get an "invitation" to try out the beta Yahoo site...and then be told that it does not yet support my browser (Safari/WebKit). :smile:

By janeythecrazy, # 24. April 2007, 05:20:50

avatar
Dante: that's bug 208477, still ASSIGNED but considered high priority.

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

By hallvors, # 25. April 2007, 14:16:12

avatar
it suks na just playing im hipper

By rachel lynn, # 26. April 2007, 15:57:58

avatar
it suks na just playing im hipper

By rachel lynn, # 26. April 2007, 15:58:02

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.