Opera mini detection failure

dilip.joshi@qubecell.com
Posts: 6
Joined: Mon May 27, 2013 8:25 am

Opera mini detection failure

Postby dilip.joshi@qubecell.com » Fri May 31, 2013 12:59 am

Hi,

I tried to detect the browser on Nokia E5-00 using opera mini but I get Nokia BrowserNG as the browser.

Can anyone help? Below is my code -

require_once('wurfl/TeraWurfl.php');
$wurfl = new TeraWurfl();
$matched = $wurfl->getDeviceCapabilitiesFromAgent();
$browser = $wurfl->getDeviceCapability("mobile_browser");

echo $browser . "<br>";

I also tried passing $_SERVER['HTTP_USER_AGENT'] to getDeviceCapabilitiesFromAgent(), but no luck.

Regards,
DJ

dilip.joshi@qubecell.com
Posts: 6
Joined: Mon May 27, 2013 8:25 am

Re: Opera mini detection failure

Postby dilip.joshi@qubecell.com » Fri May 31, 2013 1:22 am

Also when I tested it from a Samsung device it gave me Openwave mobile browser, where I did a check in the headers and my script returned opera correctly. Below is the small script I used -

$ua = $_SERVER['HTTP_USER_AGENT'];
//echo $ua . "<br>";
if (eregi('opera mini', $ua))
{
echo "Opera";
}

Regards,
DJ

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Opera mini detection failure

Postby kamermans » Fri May 31, 2013 9:55 am

Hi DJ,

You've highlighted an area that is regularly debated: if the API must decide between detecting the device or detecting the browser, but not both, what should it choose? Currently, the Database API will err on the side of the device for OperaMini requests, since OperaMini does not send much helpful information in its user agent string. Inside the HTTP request, the OperaMini user agent and the original user are available and there is some logic in the API that decides which one to use. This having been said, passing the raw HTTP_USER_AGENT should do the trick and provide you with an "Opera Mini" response. Can you post the Opera Mini user agent that you are testing?
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

dilip.joshi@qubecell.com
Posts: 6
Joined: Mon May 27, 2013 8:25 am

Re: Opera mini detection failure

Postby dilip.joshi@qubecell.com » Mon Jun 24, 2013 1:54 am

Hi Steve,

Pls find below the HTTP_USER_AGENT data -

Mozilla/5.0 (Symbian OS/9.3; Series60/3.2 NokiaE5-00/101.003; Profile/MIDP/2.1 Configuration/CLDC-1.1 ) AppleWebkit/525 (KHTML, like Gecko Version/3.0)

This is on a Nokia phone via Opera mini browser.

Rgds,
DJ

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Opera mini detection failure

Postby kamermans » Mon Jun 24, 2013 10:33 am

This particular user agent string is not being matched because it is invalid.

Code: Select all

Mozilla/5.0 (Symbian OS/9.3; Series60/3.2 NokiaE5-00/101.003; Profile/MIDP/2.1 Configuration/CLDC-1.1 ) AppleWebkit/525 (KHTML, like Gecko Version/3.0)
In the UA you've pasted (above), there is a space between "Symbian" and "OS", which is not present in real requests. If this space is removed the device is detected properly. I can dig a little deeper, but in the most recent 10,000,000 requests that I have seen, I see no instances of "Mozilla/5.0 (Symbian OS", and 415,417 instances of "Mozilla/5.0 (SymbianOS".
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 3 guests