Mac OS X check if flash is installed

My Mac OS X opens a web page through a WebView that requires Flash. If the user does not have flash installed, I would like to give them a popup that says that they install flash.

Is there a way to check webview if Flash plugin is installed? In WebPreferences you can enable / disable plugins, but I cannot find a way to request current settings / included.

Thanks for any help.

+4
source share
2 answers

You may be able to write JavaScript that performs validations and executes it through a WebView window object. To do this, you will need to read the JavaScript navigator object, in particular navigator.plugins .

+5
source
  • You can verify the installed version of Flash using the shell command: /usr/libexec/PlistBuddy -c 'Print CFBundleVersion' /Library/Internet\ Plug-Ins/Flash\ Player.plugin/Contents/Info.plist

  • Apple has provided JavaScript code to detect plugins in various browsers . If you include this file, you can use the redirect either to the Flash site or to your pop-up window: detectFlash("http://www.site.com/flashcontent","http://www.site.com/noflash")

  • Per @Brian Kyle is a great suggestion, you can check out Flash in navigator.plugins:

 var pluginCount = navigator.plugins.length; for(var i = 0; i < pluginCount; i++){ if(navigator.plugins[i].name=="Shockwave Flash") { document.write("Flash version " + navigator.plugins[i].version); break; }; }; 
+2
source

All Articles