2

I have an Ektron site, which is using WURFL (latest version, 2.3.2) to detect the device. When browsing to the site using IE9, the user is shown the mobile version of the site.

The user agent is-

Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)

When I enter this UA on the WURFL homepage, it shows as a generic web browser.

However, when using the Asp.NET WURFL library, it is detected as a mobile.

The following code-

IWURFLManager wurflManager = wurflManagerProvider.WURFLManager;
IDevice device = wurflManager.GetDeviceForRequest(Request);
var device_os = device.GetCapability("device_os");
var device_os_version = device.GetCapability("device_os_version");
var device_model = device.GetCapability("model_name");

deviceinfo.Text += "WURFL Model: ";
deviceinfo.Text += device_model;

deviceinfo.Text += "WURFL Device OS: ";
deviceinfo.Text += device_os;

deviceinfo.Text += "WURFL Device OS Version: ";
deviceinfo.Text += device_os_version;

Outputs-

WURFL Model: Windows Mobile 7.5
WURFL Device OS: Windows Phone OS
WURFL Device OS Version: 7.5

Why is this happening?

Spongeboy
  • 2,232
  • 3
  • 28
  • 37

2 Answers2

1

The problem is that WURFL is not designed to distinguish between desktop devices and mobile devices. It only focuses on mobile devices. Desktops are often detected as mobile devices. A workaround is to include a desktop_browser_patch.xml file. However you would have to add Firefox 15 and 16 manually to the patch file and continue to update it with every version of Firefox that comes out.

I found it was better to use a Regular expression on the User agent to determine if it is desktop or Mobile. Only use Wurfl to detect the device capabilities if it is a mobile device. There are several Regular expressions on-line. They are all imperfect. Also check Request.Browser.IsMobileDevice. If that is true, then it is a mobile device. If that is false then it may or may not be a mobile device.

maddoxej
  • 1,662
  • 13
  • 19
1

I am a little late to the party here, but I worked with Ektron support on this issue.

Up to Ektron version 8.6 they were using tholder WURFL API driver. And it does not work correctly. Not only was it detecting IE 9 as a mobile browser, it was also not detecting Android OS 4.0+ as a mobile browser (showed desktop always).

Patch files also did not solve the issue.

The reasoning i got for this issue was because it was not reading through the entire wurfl.xml.gz file.

After many rounds of back and forth with Ektron support, it was decided that it would be a huge undertaking to produce a hotfix for Ektron 8.6 to fix this issue.

Upgrading to Ektron 8.7 takes care of the issue as it uses the new WURFL API driver and detects IE 9 and Android correctly now.

Jon Price
  • 186
  • 3
  • 11