Created
November 13, 2010 17:18
-
-
Save getify/675496 to your computer and use it in GitHub Desktop.
detecting if flash plugin is installed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false)); |
See my gist at https://gist.github.com/JamesDunne/174ebedbc9afaf2078a7
Am facing an issue with latest Firefox 55 (win64). navigator.plugins is not returning "Shockwave Flash" even though flash is installed.
Could anyone suggest how to resolved this.
Thanks,
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Best version so far is a slightly modified version of
chustedde
's code but with an!== false
check instead of!= false
:var ie_flash; try { ie_flash = (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false) } catch(err) { ie_flash = false; } var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || ie_flash); _flash_installed;
The last
_flash_installed;
statement is to have the JS console report the final result. Without it, Chrome, for example, would report "undefined".