Skip to content

Instantly share code, notes, and snippets.

@olsososo
Created November 1, 2013 03:41
Show Gist options
  • Save olsososo/7260677 to your computer and use it in GitHub Desktop.
Save olsososo/7260677 to your computer and use it in GitHub Desktop.
获取浏览器插件 检查是否有某个插件
function getPlugins(name){
var hasPlugin = false;
(function(){
for(var i=0;i<navigator.plugins.length;i++){
w(navigator.plugins[i].name);
if(name && navigator.plugins[i].name.toLowerCase().indexOf(name.toLowerCase()) > -1){
hasPlugin = true;
}
}
})();
return hasPlugin;
}
w(getPlugins("QQPCMgr Detector"));
function w(message){
document.write(message+"<br>");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment