Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
Modern or Non-deprecated way to detect flash player with js/jquery?

First of all, sorry for ressurrecting this question here. I've been trying for two days how to reach this job using javascript/jquery and i think i've read all stack overflow and other blogs posts about that, so please, don't mark it as duplicated because I can't use out-dated scripts from 2012 now in 2017.

I've a single page that redirects to a third party e-learning platform where some content needs flash to work. Many users don't care about which software is installed on their machines (what a new, huh) so i need to detect it and show the tipical message "please install/update flash player clicking here", but i cannot find a "modern" script/way to do this, in any place, simplified, if possible.

All scripts i've tried are deprecated or returns false in all browsers, even i've newest version of flash installed and active.

Anny help will be appreciated (except links to older posts or scripts that don't work nowadays, obviously).

Thanks a lot!

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

There is a simple way to check for Flash since all the installed and enabled plugins will be listed in navigator.plugins;

Note that if a plugin is installed, but not enabled, it will not be detected in the navigator.plugins array. There is NO way to detect this using Javascript (this Question which confirms the same).

Having said that, use the following function isFlashEnabled(); to detect Flash :

<html>

<script>

if(isFlashEnabled()) 
{ document.write('Flash is installed (but may need to be enabled)'); } 
else { document.write('Flash is either not installed or disabled'); }

function isFlashEnabled() 
{
    var flash = navigator.plugins.namedItem('Shockwave Flash');
    if (!flash) { return 0; } 
    else { return 1; }
}

</script>

<body> <embed src="https://www.w3schools.com/tags/helloworld.swf"> </body>

</html>
about 4 years ago · Santiago Trujillo Report

0

You can get an array which contains all installed plugins of a browser like this:

var plugins = navigator.plugins;

Then you can then check if the array contains the flash plugin.

From https://developer.mozilla.org/de/docs/Web/API/NavigatorPlugins/plugins:

function getFlashVersion() {
   var flash = navigator.plugins.namedItem('Shockwave Flash');
   if (typeof flash != 'object') {
      // flash is not present
      return undefined;
   }
   if(flash.version){ 
     return flash.version;
   } else {
     //No version property (e.g. in Chrome)
     return flash.description.replace(/Shockwave Flash /,"");
  }
}
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!