Skip to content

Instantly share code, notes, and snippets.

@luisenriquecorona
Created November 25, 2020 23:01
Show Gist options
  • Save luisenriquecorona/2396f5eaf4716757c683368eb62418e9 to your computer and use it in GitHub Desktop.
Save luisenriquecorona/2396f5eaf4716757c683368eb62418e9 to your computer and use it in GitHub Desktop.
Plug-in Detection.js
// plugin detection - doesn't work in Internet Explorer 10 or below
let hasPlugin = function(name) {
name = name.toLowerCase();
for (let plugin of window.navigator.plugins){
if (plugin.name.toLowerCase().indexOf(name) > -1){
return true;
}
}
return false;
}
// detect flash
console.log(hasPlugin("Flash"));
// detect quicktime
console.log(hasPlugin("QuickTime"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment