Created
November 1, 2013 03:41
-
-
Save olsososo/7260677 to your computer and use it in GitHub Desktop.
获取浏览器插件 检查是否有某个插件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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