How can I detect if Flash is installed and if not, display a hidden div that informs the user?
Use swfobject. it replaces a div with the flash if it is installed.
see: http://code.google.com/p/swfobject/
One-liner JavaScript to detect if flash is installed
As a summary of the above comments as requested:
The following SO answer is applicable: How can I detect if Flash is installed and if not, display a hidden div that informs the user?
Especially the comments / discussion of the above question are useful. I only remember that when we have used a Flash check we had combined two checks for some reasons I cannot recall. This was prior the iPad age, nowadays I'd check against the common [x]Pads if these are among the target audience. Maybe you combine the Flash and Browser check, e.g. once you know the browser is SAFARI/iPad you know it is not supporting Flash.
Try to encapsulate the check so you can change / extend it if required (that was useful for us).
How to check with JS if flash is installed, or not?
If you’re using Flash to progressively enhance a document, please use this script to feature detect it first.
var hasFlash = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));
hasFlash
will be true
if Flash is available, or falsy if it isn’t.
If you already have access to the Flash element you want to use then you could just do:
var hasFlash = 'Pan' in element;
Source: https://gist.github.com/675496
Related Topics
Syntax for an Async Arrow Function
Check If Url Scheme Is Supported in JavaScript
Javascript/Jquery: Test If Window Has Focus
Limited Parallelism with Async/Await in Typescript/Es7
How to Stop Event Bubbling on Checkbox Click
Reformat String Containing Date with JavaScript
Javascript: Getting Imagedata Without Canvas
Selecting Multiple from an HTML Select Element Without Using Ctrl Key
Jquery Script Works in Jsfiddle But Not on HTML Page
Inlining Ecmascript Modules in HTML
Difference Between "Module.Exports" and "Exports" in the Commonjs Module System
Easy to Understand Definition of "Asynchronous Event"
Intercepting Call to the Back Button in My Ajax Application
Completely Removing Duplicate Items from an Array
How to Solve 'Redirect Has Been Blocked by Cors Policy: No 'Access-Control-Allow-Origin' Header'
HTML Alignment Issue in One MAChine Only (Both IE8)