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

Stats: 16,682 members, 64,099 Topics, 14,592 Comments. Date: March 26, 2019, 3:57 am

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:

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

CEO and founder of Forgenest Inc.

Don't have an account? Use the form below to signup for a Nigeria Student Forum Account

Full Name:
Username: E.g Seuncoded
Confirm Password:

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
Itz Overcomer

1 Like

Viewing this topic:
1 guest viewing this topic
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.