Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHARED: How To Detect Opera Mini Version
#1
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:

Code:
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.
PHP Code:
var isOperaMini = (navigator.userAgent.indexOf'Opera Mini' ) > -); 


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.
PHP 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.
PHP Code:
var operaVersion navigator.userAgent.match( /Version\/([1-9]+\.[0-9]{2})/ )[1]; 



Source: https://dev.opera.com/articles/opera-min...avascript/

@dealwap, @laive, @deelino, @dynamo, @hackinubee, @abscheat, @cavdy
CEO of Forgenest Inc. http://forgenest.com
Visit http://epage.cf/jonath45
[-] The following 4 users Like jonath45's post:
  • Cavdy, dealwap, Hackinubee, ibraheem
#2
Nice tut bro, This could be useful. Smile
Posting From http://ncgblog.ga
[-] The following 1 user Likes Dynamo's post:
  • jonath45
Reply
#3
Good one
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  SHARED: Zero Javascript. Detect Any Mobile Device, Pc, Or Browser. Ahkohd 1 432 07-26-2016, 05:17 PM
Last Post: dealwap



Users browsing this thread: 1 Guest(s)

About Nigeria's Creative Talents

Nigeria's Creative Talents is an online community where every creative Nigerians can share ideas with themselves.

For any more information, please use our contact form.

              User Links

              Advertise