Welcome, Guest: Join Nigeria Student Forum / Login / Trending Now / Recent

Stats: 14,396 members, 49,300 Topics, 11,081 Comments. Date: November 14, 2018, 3:16 pm

TEXT AD: To place a text-based advert here. Call Seuncoded - +2348165799053
How To Detect Opera Mini Version. by jonath45 (m): 8:13pm on November 3
99% of the time, you should use feature detection to determine whether a browser supports a particular feature or API.

Yet sometimes browser sniffing is the right choice. There are two approaches you can take to detect Opera Mini.

You can:
• Examine the user agent string
• Check for the presence of the operamini object Using the user agent string

As with most browsers, Opera Mini identifies itself through the navigator object, and its userAgent property. Its user agent string adheres to the following pattern:
Opera/9.80 ( $PLATFORM ; Opera Mini/$CLIENT_VERSION / $SERVER_BUILD ; U; $CLIENT_LANG ) Presto/ $PRESTO_VER Version/$OPERA_VER

To detect whether a particular request is (presumably) from Opera Mini, check for the presence of Opera Mini in the user agent string. An example follows.
var isOperaMini = (navigator.userAgent.indexOf( 'Opera Mini' ) > -1 );

Detecting Opera Mini Using the window.operamini property
Opera Mini also includes an operamini object as a property of the window object. To check for the presence of this object, use the following code.
var isOperaMini = Object .prototype.toString.call(window.operamini) === "[object OperaMini]";

Using Navigator's User-Agent
Unfortunately, navigator.appVersion is not an accurate way to determine which version of Opera you’re using (here’s why). Instead, you’ll need to parse the value of the navigator.userAgent string.
An example using regular expressions is shown below.
var operaVersion = navigator.userAgent.match( /Version/([1-9]+.[0-9]{2})/ )[1];


Source: https://dev.opera.com/articles/opera-mini-and-javascript/

@seuncoded, @akinz

1 Like

Forgenest Inc.

Don't have an account? Use the form below to signup for a Nigeria Student Forum Account and start earning for every posts and comments.


Sponsor: 0
Full Name:
Email:
Username: E.g Seuncoded
Password:
Confirm Password:
Country:


I agree to the terms of service

Re: How To Detect Opera Mini Version. by Michael08 (m): 10:35pm on November 3
Wow really I never knew, thanks for the update

1 Like

Re: How To Detect Opera Mini Version. by Overcomer (m): 11:23pm on November 3
that's nice, thanks for sharing

1 Like

Viewing this topic:
1 guest viewing this topic
Download the Ngstudentforum app for Android Devices

Nigeria Student Forum - Copyright © 2016 - 2018. Fadeyi Oluwaseun All rights reserved. - See How To Advertise
Disclaimer: Every Nigeria Student Forum member is solely responsible for anything that he/she posts or uploads on Nigeria Student Forum.