There are times when we need to detect if the browser has some plugins installed to know if the browser has the relevant capabilities. The most common is the Flash plugin, if the user's browser is not installed, then Flash video will not play properly.
The following are dry foods:
1 //Athor:manley2 3 //Data:2015/12/304 5 //fcuntion: Browser Install plugin detection6 7 8 9 //Note: The invocation of the parameter, ie and non-IE kernel are called separately detectionTen One A - functionChecehasplugin (name) {//detect whether the browser contains a plug-in, the plug-in name to be transmitted correctly, the case does not matter - the varName=name.tolowercase (); - - for(vari=1;i<window.navigator.plugins.length;i++){ - + if(Navigator.plugins[i].name.tolowercase (). IndexOf (name) >-1){ - + return true; A at } - - } - - } - in - to functionCheckiehasplugin (name) {//detect whether IE browser contains a plug-in, the plug-in identifier to be transmitted correctly, case does not matter + - Try{ the * NewActiveXObject (name); $ Panax Notoginseng return true; - the}Catch(ex) { + A return false; the + } - $}
View Code
JS Browser Installation Plugin detection