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

Stats: 15,596 members, 57,654 Topics, 13,659 Comments. Date: January 19, 2019, 2:05 am

NSF Banner Ads NSF Banner Ads NSF Banner Ads
How To Detect Opera Mini Version. by jonath45 (m): 8:13pm on November 3
Jonathan Irhodia


100Level, Nigeria.
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

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.


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
Ojedeji Michael
, Nigeria.
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
Abdulazeez Adeshina
National Open University of Nigeria
Bsc. Economics
200Level, Nigeria.
that's nice, thanks for sharing

1 Like

Viewing this topic:
2 guests viewing this topic
NSF Banner Ads NSF Banner Ads NSF Banner Ads
Download the Ngstudentforum app for Android Devices

Nigeria Student Forum - Copyright © 2016 - 2019. 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.