Page 1 of 1

Opera mini detection failure

Posted: Fri May 31, 2013 12:59 am
by dilip.joshi@qubecell.com
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

Re: Opera mini detection failure

Posted: Fri May 31, 2013 1:22 am
by dilip.joshi@qubecell.com
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

Re: Opera mini detection failure

Posted: Fri May 31, 2013 9:55 am
by kamermans
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?

Re: Opera mini detection failure

Posted: Mon Jun 24, 2013 1:54 am
by dilip.joshi@qubecell.com
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

Re: Opera mini detection failure

Posted: Mon Jun 24, 2013 10:33 am
by kamermans
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".