Anne van Kesteren

Flash detection

I think everyone has heard about plugins and IE. It is especially hated, 'cause it effects the use of Flash. Though most standard developers dont't use it, it can achieve nice effects. So I wanted to create a solid JavaScript that checks if Flash is installed and if, some markup should be generated. So far I have a couple of problems with generating the markup.

First, the test cases (Yes I know, that's the only thing a log about, but I like testing stuff) for checking if flash exists. I have made 2 test cases. One is valid HTML4.01 Strict, the other is valid XHTML1.0 Strict and will be send as application/xhtml+xml to the following browsers: Opera 6 and & 7, the validators (although that doesn't matter) and any browser that 'accepts' application/xhtml+xml. I think I should exclude Opera, 'cause that browser is having some trouble, but for these tests, it is in:

  1. Flash detect HTML4.01 Strict example page
  2. Flash detect XHTML1.0 Strict example page

Note that I did not create the Flash detect script myself. I only combined two existing scripts into one that is in my opinion more solid. The whole script is the same as Flash detect from Peter-Paul Koch, but writes the VBS away the same as this script does: Flash Detection Only. This has the advantage that you only need one file instead of two for the detection itself. The only disadvantage I have now is that you need to specify within the VBScript until which version you want to check. I made that version 8, but a better option might be 10 er something. It should not be too high, 'cause then IE will not handle it I think.

I did some browser testing myself on Windows XP. Here an unordered list of the results:

I think we can state most browser can handles the JavaScript and IE can handle the needed Visual Basic Script, what a surprise :). It is actually not really funny that we needed to check it with VBS for Internet Explorer since that requires at least one extra server hit. We need one file for checking and a following file for handling the results. Otherwise it was all possible from within one file. I don't have any more time to write about my 'write Flash-embed markup with the DOM' tests, but I can assure you, that some browsers have serious problems :).

Comments

  1. Both scripts work fine in IE5 for Win98se and (no surprise) Mozilla Firebird 0.6.1 for WinXP

    FYI, VBS stands for VisualBasic Script, not Virtual Basic Script.

    Posted by Dave Strus at

  2. Werkt hij alweer? Iemand hier had een mailbox vol laten lopen, waardoor alle accounts werden geblocked (inmiddels al 50MB extra serverruimte ingekocht). Ik dacht ook al: wat krijg ik verdacht weinig mail binnen... ;)

    Posted by Robbert Broersma at