8

I know most mobile browsers don't support javascript,

how can I check this?

user198729
  • 61,774
  • 108
  • 250
  • 348
  • 1
    If there's no JavaScript support on the browser, what are the chances that the browser will support Flash? – sarnold Aug 04 '10 at 10:02

3 Answers3

2

Don't hold it against me if it isn't helpful ;) But this seems relevant: http://kb2.adobe.com/cps/140/tn_14086.html

From the site (edited and abridged):

This approach to Flash Player detection relies on two key elements; a Flash plug-in "sniffer" that uses the GetURL action which only the Flash 4 Player will respond to, and an HTML page with a META refresh tag.The index page of the site will use a Flash movie to detect for version 4 of the Flash Player and direct those browsers to the Flash 4 content. If the user hits the index page either without the Flash Player or with version 2 or 3 of the player, the META refresh tag will automatically send them to a non-Flash page which will prompt them to download version 4 of the Flash Player. This scheme works without using any JavaScript, making it both simpler and more browser-compatible.

Creating a Flash 4 "sniffer":

  1. Create a new Flash movie ...

  2. In Modify > Movie set the movie's dimensions to 18px wide and 18px high. This is the smallest a Flash movie can be created ...

  3. Insert keyframes on frame 1 and 2. Select frame 2 and choose Modify > Frame. In the Frame Properties dialog box attach a Get URL action. In the URL field put the URL to the HTML page that will make up the real Flash site. Most importantly: put the URL in quotes and set the Get URL field to expression. This assures that only the Flash 4 player will execute this action.

  4. Add another action to this list - Stop. Select OK.

  5. Using the Flash 4 Publish feature, create an HTML file using the Flash 4 only (default) template. This will be the index.html page for this Flash site.

Creating a META refresh tag in a HTML document:

  1. Open the index.html document in an editor such as Macromedia's Dreamweaver.
  2. In the <HEAD> tag of the HTML document create a META refresh tag ... <META HTTP-EQUIV="Refresh" CONTENT="10; URL=alternative.html"> ... The file name "alternative.html" should be substituted with the name of your page that contains the alternate content, in the case that the user does not have the Flash 4 Player installed.
  3. [Create the alternative page - alternative.html - or whatever you've named it]
  4. [Add appropriate content and links to the relevant flash download pages]
Community
  • 1
  • 1
Merlyn Morgan-Graham
  • 58,163
  • 16
  • 128
  • 183
0

Use the navigator properties mimeTypes and plugins Adobe provides documentation on how to check this.

if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) {
  // hasSupport
}
Marcel Jackwerth
  • 53,948
  • 9
  • 74
  • 88
  • That method of detection is incredibly outdated, and doesn't even work on IE 8, let alone a mobile browser. It also sounds like the OP is looking for a non-JS detection method. – Matt Ball Jul 26 '10 at 16:04
  • Yes,I'm seeking of a non-JS method. – user198729 Jul 27 '10 at 12:11
0

Most browsers (including mobile ones) sent a Accept header as part of the http request which will tell you what content-types it can accept so you might find application/x-shockwave-flash there.

I'm not sure if this is reliable anymore on mobile browsers though as have been out of the mobile industry for a couple of years

Another option is to query sources like WURFL or UA-Prof to try determine if the phone supports what you require - but this will not always work - especially if an alternate browser is being used on the phone

saret
  • 2,217
  • 13
  • 12