我正在使用名为 FiftyOne Degrees ( http://51degrees.mobi ) 的第 3 方设备检测应用程序。
该应用程序使用 WURFL ( http://wurfl.sourceforge.net/ ) 根据用户代理找出请求页面的设备类型。
这很好用,除了在新的 Fire Fox 4 中。我认为这是因为 FF4 是在 2011 年 3 月 22 日发布的,而 WURFL 最后一次更新是在 2011 年 3 月 6 日。
有没有其他人遇到过这个问题?有什么解决办法吗?
我正在使用名为 FiftyOne Degrees ( http://51degrees.mobi ) 的第 3 方设备检测应用程序。
该应用程序使用 WURFL ( http://wurfl.sourceforge.net/ ) 根据用户代理找出请求页面的设备类型。
这很好用,除了在新的 Fire Fox 4 中。我认为这是因为 FF4 是在 2011 年 3 月 22 日发布的,而 WURFL 最后一次更新是在 2011 年 3 月 6 日。
有没有其他人遇到过这个问题?有什么解决办法吗?
您可能还需要重建 FiftyOne.Foundation.dll,源代码可以在这里找到:
http://51degrees.codeplex.com/
有了新的 dll 并在 App_Data 文件夹中更新了 web_browsers_patch.xml,我能够解决我的 FF4 移动重定向问题。
这是我使用的 XML:
<device user_agent="Firefox/4.0" fall_back="firefox" id="firefox_4">
<group id="product_info">
<capability name="model_name" value="4.0" />
</group>
</device>
我使用的是旧版本的 DLL,仅 XML 不足以让 FF4 被识别。
我认为最简单的方法是查看 wurl 的网络浏览器补丁文件。(http://wurfl.sourceforge.net/web_browsers_patch.xml) 它包含了人们通常使用的所有浏览器。您应该在 App_Data 文件夹中有此文件。您应该能够使用对 firefox 4 的引用来更新您的补丁文件,并声明一个备用浏览器类型。
我正在使用此处找到的用户代理字符串:http: //hacks.mozilla.org/2010/09/final-user-agent-string-for-firefox-4/
<device user_agent="Firefox/3.5" fall_back="firefox" id="firefox_3_5">
<group id="product_info">
<capability name="model_name" value="3.5"/>
</group>
</device>
可以改为:
<device user_agent="Firefox/4.0" fall_back="firefox" id="firefox_4_0">
<group id="product_info">
<capability name="model_name" value="4.0"/>
</group>
</device>
我以前没有遇到过这个问题,但这是我处理您的问题的方式。希望这可以帮助 :)
这是我发现对我有用的解决方法。
我在 web_browsers_patch.xml 中添加了以下内容,然后进行了 iisreset。
<!-- work around -->
<device user_agent="Firefox/4.0" fall_back="firefox" id="firefox_4">
<group id="product_info">
<capability name="model_name" value="4"/>
<capability name="is_wireless_device" value="false"/>
</group>
</device>
<device user_agent="Firefox/4.0" fall_back="firefox" id="sony_mylo_ver1_sub1" >
<group id="product_info">
<capability name="model_name" value="4"/>
</group>
</device>
<device user_agent="Firefox/4.0" fall_back="firefox" id="sony_mylo_ver1" >
<group id="product_info">
<capability name="model_name" value="4"/>
</group>
</device>
<device user_agent="Firefox/4.0" fall_back="firefox" id="stupid_novarra_proxy_sub73" >
<group id="product_info">
<capability name="model_name" value="4"/>
</group>
</device>
<!-- end work around -->