2011-09-14 49 views
1

在Firefox我可以引用检测插件的版本号在Chrome

navigator.plugins["myplugin"].version 

但物业“版本”不存在铬。我正在使用的特定插件是Citrix Client Receiver插件(download here)。

任何人都知道我不知道我在哪里或如何能够在Chrome中使用JavaScript获取此插件的版本号?

回答

0

获得在Chrome插件的版本号的唯一方法是解释name

//Example, Shockwave Flash 
var version = navigator.plugins["Shockwave Flash"].name.match(/([\d.]+)/); 
//used semicolons (grouping) inside the Regular expression, to allow the 
// possibility of defining a more detailed/exact version position. 

version = version ? version[1] : ""; 
+0

唉,思杰不把任何版本信息到name属性。我想我卡住了,呃? – Trevor

+0

如果您需要特定于版本的功能,请使用try {..test ..} catch(e){/ *不支持* /}'来测试是否存在特定的功能(并且因此受支持)。 –