更新:2007 年 11 月
在管理员将 XAML 浏览器应用程序 (XBAP) 部署到使用 Firefox 2.0+ 作为浏览器的客户端计算机之前,必须首先确认是否安装了 Firefox 2.0+。本主题提供一个以 HTML/JavaScript 编写的脚本,管理员可以使用该脚本来确定系统上是否存在 Firefox 2.0+。
![]() |
---|
有关安装、部署和检测 .NET Framework 的详尽信息,请参见从何处获取 .NET Framework 可再发行组件包。 |
示例
在安装 .NET Framework 3.5 时,客户端计算机配置了用于 Firefox 2.0+ 的插件,该插件使 Firefox 2.0+ 可以承载 XAML 浏览器应用程序 (XBAP)。下面的示例脚本在检查“Windows Presentation Foundation”插件之前,会检查脚本是否由 Firefox 2.0+ 承载。无论结果如何,该脚本都会显示相应的状态消息。
<HTML>
<HEAD>
<TITLE>Test for the Firefox Plugin for WPF</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<SCRIPT type="text/javascript">
<!--
function OnLoad()
{
// Check if browser is Firefox
if( navigator.plugins.length == 0 ) {
document.writeln("The browser must be Firefox 2.0+.");
return;
}
// Check for WPF plugin and report
var msg = "Windows Presentation Foundation Plugin for Mozilla Firefox is ";
var wpfPlugin = navigator.plugins["Windows Presentation Foundation"];
if( wpfPlugin != null ) {
document.writeln(msg + " installed.");
}
else {
document.writeln(msg + " not installed. Please install or reinstall the .NET Framework 3.5.");
}
}
-->
</SCRIPT>
</HEAD>
<BODY onload="OnLoad()" />
</HTML>
如果搜索“Windows Presentation Foundation”插件成功,将显示下面的状态消息:
Windows Presentation Foundation Plugin for Mozilla Firefox is installed.
否则,显示下面的状态消息:
Windows Presentation Foundation Plugin for Mozilla Firefox is not installed. Please install or reinstall the .NET Framework 3.5.
如果该脚本由 Firefox 2.0+ 以外的浏览器承载,将显示下面的状态消息:
The browser must be Firefox 2.0+.