2011-09-14 58 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){/ *不支持* /}'來測試是否存在特定的功能(並且因此受支持)。 –