Bad Flash Sniffers
Every time Macromedia releases a new version of the Flash player, from Flash 4 to 5 to 6 and now 7, web sites everywhere break. Not because of a buggy public beta player, but because certain web developers build (or copy) Flash player sniffers coded in JavaScript that utterly fail to provide any forward compatibility.
In other words, if a user is using a Flash player that is version '6 or higher' (6+) then provide the swf. Otherwise, embed a gif, a jpeg, or if you're really fucking obnoxious, shuttle them off to a blank, non-navigable page without a back door. But far too many developers fail this simple task, and instead detect for strict version numbers (4, 5, 6) without any wiggle room in case a new player is released.
I've harped on this before, but fugly JavaScript sniffers are a gargantuan pet peeve. The way I see it, if you have enough skill to code a decent slice of HTML, you have the ability to type a '+' next to your variables.
If you are a web developer, or have friends overseeing a popular corporate site with Flash content, double-check your sniffers, and alert others to the new public beta of Flash player 7. The web would be a better place.
Comments
I have to do this today for the first time in a while. Is there something wrong with the detection JS that flash exports? Could you recomend a recource online that shows how do to it right?
Posted by: Ryan Schroeder at August 7, 2003 10:18 AM
Here's one approach: fairly foolproof and futureproof but not without its own issues.
Build a flash movie in your chosen version of flash. Make it 8px by 8px. It does nothing more than getURL("the_flash_page.html") . (don't take my word for it on that syntax) call it, say, sniffer.swf
the_flash_page.html contains the actual flash site.
embed sniffer.swf in your entry html page. This page has a meta-refresh that diverts to no_flash.html after, say, 5 seconds.
This was the only reliable technicque back when IE Mac couldn't tell you via javascript whether it had Flash or not. These days it might not be strictly necessary. And refreshes can be a pain because they break the back-button. But it's still foolproof. If you can play the flash movie, you will get the flash movie.
Posted by: Jake Grimley at August 7, 2003 11:09 AM
Or even better:
http://www.dithered.com/javascript/flash.html
The best detection i've seen. Hopefully of use to you.
Posted by: Sam at August 7, 2003 11:27 AM
Moock's JavaScript sniffer is still one of the best. Forward compatible with Flash Player 7. Or 8...9...
Posted by: Todd Dominey at August 7, 2003 11:30 AM
I agree Todd, Moock's is the best sniffer I have seen. I've used it on a couple of projects and it does very well with no updating needed. Plus it's fast. Barely notice its there.
I don't mind going through a check and failing because I am using a mac browser that the developer has obviously not accounted for, but for crying out loud give me a link that says "I know I have the flash plugin let me in 'cause your script sucks."
Posted by: Steven at August 7, 2003 12:13 PM
Speaking of sniffing, do you want to rip your hair clean out of your head? I'm a student at Boston University (link). Check out their main page.
Nevermind that it looks like crap, have a look at the code. Tables for layout, Javascript rollovers for no real good reason, and yes, Flash AND browser sniffers (using exact version numbers) at the bottom end of the page. Why are they sniffing? WHY?
To my knowledge, BU's main page has never presented a browser with an alternate page of any kind, nor does it use any Flash on that particular page. Am I just not seeing the reason for it?
FYI, I constructed a duplicate version of the page using CSS. Theirs is about 20k. Mine is about 5k. *sob*
Posted by: Jonathan Dobres at August 7, 2003 12:23 PM
Joathan, according to the source code BU is using Moock's sniffer
// moock fpi [f.lash p.layer i.nspector]
// version: 1.3.5
Looks as if it's forward compatible at least
:: flash6Installed = flashVersion >= 6;
And they are using Dreamweaver to construct web pages - thus the crappy tables.
Posted by: Ed at August 7, 2003 3:55 PM
The question remains: why are they sniffing in the first place? There's absolutely no need to do in this case.
Posted by: Jonathan Dobres at August 7, 2003 4:57 PM
I know this is off topic but...
ED
blame the developer not the tool, One can create code as good in DW as notepad, or bbedit or...
on topic
This whole bad detection script is coming up again and again!
Maybe we need some serious documentation in flash manuals to set some standards. Personally I dislike sending users to different pages as this breaks back button functionality, so I like gateway pages, without getting back to the whole splash thing...
hmmm... I had a point somewhere, but then I sorta lost it?!
Suffice it to say that we all do need to try to educate of peers on the value of coding these kinda detection scripts better
Posted by: scottbp at August 7, 2003 7:54 PM
(1) Download the new version of the Flash Player. (2) Receive validation from Macromedia's website within Safari. (3) Choose
Nike Golf as the first suggested site to see Flash in action. (4) See this message instead, "You are here because you don't have Flash 6 player or have an older player version." (5) Curse.
Posted by: Kawika Holbrook at August 7, 2003 8:06 PM
Kawika : I always wondered why the f*** I couldn't watch certain flash movies even though I had the latest player installed. Thanks for clearing this up for me - I feel truly enlightened.
Posted by: Mary Veer at August 8, 2003 12:06 AM
How come I don't see anyone talking about getVersion? Works back to 5, no messy javascript that might break, combine that with Jake's getURL above and you can also figure out if someone has Flash 4 or no player at all. I lean towards actionscript-only detection, I don't know how others fare with it.
Posted by: Al Abut at August 8, 2003 1:48 AM
You even have access to the "version" constant in later versions of the Flash 4 plugin...
Posted by: gwint at August 8, 2003 4:53 PM
It doesn't really work if your whole site is in flash, but when there's just some widget of motion on a whole page that i don't want to interrupt the user if they don't have it, I just use a simple object tag with just the dimensions, data and type attributes, and a couple of param tags for IE ("movie" and "quality") and place the substitute static gif within the object tag.
That way, in IE 5+ and Gecko, Konqueror, etc. if the user has Flash, it shows up, if they don't, it doesn't. And nobody knows the difference. And nobody gets sniffed.
Posted by: Wilson at August 9, 2003 11:52 PM
Show us a good sniffer script Todd. Its your duty ;)
Posted by: Neil Urban Thinking at August 10, 2003 4:23 AM
Wilson: I believe this is similar to the 'Flash Satay' technique described at ALA. If the amount of data is larger than a few K, the author recommends using a small loader to load the flash movie.
While I'm skeptical for larger Flash sites, definitely for smaller things like nav bars or eye candy it would be a good technique to use.
Aside from that, I personally prefer just using Javascript with a backup link, it seems to cover enough people. One rumored feature of Flash 7 is true server-side detection; anyone have info on this?
Posted by: A. White at August 10, 2003 11:08 PM
So what are we saying here? NEVER use the Macromedia supplied sniffer? Only use the Moock method?
Posted by: Carlos at August 11, 2003 1:37 PM
As far as which one to use, let me just say this: it's important to let the target demographic and the technical requirements of the project dictate what technique is best.
That said, I would love to see an educated pro/con discussion of 'the best' detection technique! Surely someone somewhere has done this...
My problem with sniffers: geez what a pain! I don't know about you guys, but I want to focus on content and experience instead of these huge JS sniffers. I guess it's like taking out the trash, another chore we just have to do.
I also note that MM updated their detection scheme lately. I'd post the link but can't get through; it's in DevNet. =P
Posted by: A. White at August 13, 2003 12:25 PM
I've been working detection routines since Netscape 2.0 in 1995, and I don't like them either.
But some clients want them.
The problem is that the browsers differ.
In the early days we could do a netscape.plugins evaluation for NS, and a VBScript CreateObject() routine for IE/Win. IE/Mac didn't respond to anything, but hey....
In a few years the problem shifted from plugin-detection to version-qualification... few consumers have no Macromedia Flash Player, but you're generally checking whether they have a recent version. (Stats here.) The Macromedia Flash Player does have internal properties to check version, but this implies you've first confirmed there is a Player installed.
That OBJECT substitution works for only a subset of browsers, and in those where it does work some don't support what they do with an OBJECT/EMBED pair... passing query terms in the URL, DOM identification, etc.
I've usually recommended just showing the content with a "Can't see it?" link. But people want to be fancy. Go figure.... ;-)
Posted by: John Dowdell at August 13, 2003 2:20 PM
On the subject of Flash 7 for OS X, and your website designs, I wanted to alert you that your new PGA.com site crashes Safari 1.0 on my computer (I have Flash 7 installed).
I am running OS X 10.2.6 with all the latest software updates.
Just thought I would let you know, even though it is a bit off topic.
Posted by: Jonathan LaCour at August 14, 2003 11:10 AM
Macromedia has released a new Flash Detection Kit that uses an swf and a meta-refresh as last resort (no flash at all). I have used this and have not run into any problems. I wonder why JD didn't recommend this since this is an official Macromedia solution. JD? And what if you just have/want a 100%/no-scale fluid layout swf on your page? An html 'Can't see it?' link would really mess the look and effect of that up. In that case I like to handle flash impaired browsers more 'gracefully' by showing them a nice formatted message/substitue page.
Posted by: cub at August 14, 2003 11:33 AM
Now i like your work Todd. By heck i do. Youve just done the PGA front page and thats not messing about by a long shot.
But can you do me a favour?!?
After looking at the Cadillac add i was tempted to take a look at there site and products. I found this -
Probably around $200 website. Give em a call Todd and work your magic ;)
Posted by: Neil Urban Thinking at August 14, 2003 10:36 PM
interesting tip for us usability guys to bear in mind too... thanks
Posted by: michael heraghty at August 22, 2003 4:28 PM
I'm looking for a sniffer that detects display settings (800x600, 1600x1200, etc.) and resizes the swf file accordingly. Does such an animal exist?
Posted by: J. Matthew at December 31, 2003 12:20 AM
