tags:

views:

23

answers:

1

I have a Firefox plugin that adds some optional features to my web app. I'm using an object tag in the html to embed the plugin. However, if a user doesn't have the plugin Firefox displays the message:

Additional plugins are required to display all the media on this page.

Since the plugin is just for optional features I don't want this message displayed even if they don't have the plugin.

Is there anything I can to do keep Firefox from displaying this message?

+1  A: 

You can try detecting the presence of the plugin with the navigator.plugins object using Javascript, before injecting the object needed for the additional features to work dynamically. For instance, this script will check for the presence of the Flash plugin:

for(var i = 0; i < navigator.plugins.length; i++){
    if(navigator.plugins[i].description.indexOf('Shockwave Flash') !== -1){
       console.log(navigator.plugins[i]);
       break;
    }
}
Yi Jiang
@David Thanks, added that in
Yi Jiang
@Yi, always a pleasure. (I removed the link comment, since it's a bit redundant now).
David Thomas
That's exactly what I needed! Thanks a lot.
Aaron