// Returns an array of all suffixes supported by the enabled plugins function getPluginSuffixes() { var numPlugins, plugin, mimetype, enabled, sufs, suffix; var i, j, k; var result = new Array(); for (i = 0; i < navigator.plugins.length; i++) { plugin = navigator.plugins[i]; for (j = 0; j < plugin.length; j++) { mimetype = plugin[j]; if (mimetype == null) continue; enabled = false; enabledPlugin = mimetype.enabledPlugin; if (enabledPlugin && (enabledPlugin.name == plugin.name)) { enabled = true; } if (!enabled) continue; if (mimetype.suffixes == null) continue; sufs = mimetype.suffixes.split(/,/); for (k = 0; k < sufs.length; k++) { suffix = sufs[k]; if (suffix == '') continue; result.push(suffix.toLowerCase()); } } } return result; } // Is a given suffix supported? function isPluginSuffix(target_suf) { var sufs = getPluginSuffixes(); if (sufs.length == 0) return true; // Assume yes for IE :( target_suf= target_suf.toLowerCase(); for (var i = 0; i < sufs.length; i++) { if (target_suf == sufs[i]) return true; } return false; }