I'll second the call to remove the special conditional code.. internally at google a couple of people have asked me about it because our internal compiler has problems with it. If there's a way to do it as reliably without adding much more code, I'm all for it.
As a side note, why not a super simple UA check like: ie = /msie/.test(u) && !/opera/.test(u); On Wed, Jan 28, 2009 at 9:14 PM, Philip Hutchison <[email protected]>wrote: > Interesting link. > > For those who are interested, here is the current code: > > /*...@cc_on > ie = true; > @if (@_win32) > windows = true; > @elif (@_mac) > mac = true; > @end > @*/ > > And here is the proposed code: > > if("\v"=="v") > > which would need to be reformulated to something like: > > var isIE = ("\v"=="v"); > > > I don't think the SWFObject conditional compilation code needs to be > replaced for two reasons. > > 1. The current code checks for mac (IE Mac) support, which this proposed > code doesn't do. Maybe IE Mac support isn't very important anymore, but > removing it would be a shift in browser support. > > 2. The IE sniff made famous by Dean Edwards is super simple and less > hack-y, which I think means better forward compatibility. Conditional > compilation is a safe bet in future versions of JScript, while something > like ("\v"=="v") is taking advantage of an anomoly in the system that may or > may not be patched in the future. > > Dean Edwards' original "sniff": > > var isIE = /*...@cc_on!@*/false; > > Which has an even shorter form (one character shorter than the proposed > code): > > var isIE/*...@cc_on=1@*/; > > You can read about Dean's code here: > http://dean.edwards.name/weblog/2007/03/sniff/ > > I don't see the advantage of switching to the new code. :) > > - philip > > > > On Wed, Jan 28, 2009 at 7:22 PM, Aran Rhee <[email protected]> wrote: > >> Kyle, have you been hanging out with the nerds again :) ? >> >> >> >> >> >> Well, you can't get more compact than if("\v"=="v"), that's for sure... >> >> >> >> I know the article says it works with IE7/8, but what about older versions >> of IE – Have you tried or know if it works? >> >> >> >> Aran >> >> >> >> >> >> *From:* [email protected] [mailto:[email protected]] *On >> Behalf Of *Getify Solutions, Inc. >> *Sent:* Thursday, 29 January 2009 2:03 PM >> *To:* [email protected] >> *Subject:* swfobject 2.2 suggestion... >> >> >> >> Can we replace our IE detection (the conditional compilation) with this >> trick: >> >> >> >> >> http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html >> >> >> >> --Kyle >> >> >> >> >> >> >> >> >> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/swfobject?hl=en -~----------~----~----~----~------~----~------~--~---
