Skip to content

Instantly share code, notes, and snippets.

@jalbertbowden
Created April 12, 2013 22:20
Show Gist options
  • Save jalbertbowden/5375621 to your computer and use it in GitHub Desktop.
Save jalbertbowden/5375621 to your computer and use it in GitHub Desktop.
Detecting Opera Mini using the window.operamini property via http://dev.opera.com/articles/view/opera-mini-and-javascript/#detectingmini 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]"
@PawelGIX
Copy link

PawelGIX commented Jun 5, 2014

Why not just

var isOperaMini = !!window['operamini']

@da411d
Copy link

da411d commented Jun 28, 2016

doesn't work((
i have opera mini device and even this code doesn't work

var isOperaMini = !!(Object.prototype.toString.call(window.operamini) === "[object OperaMini]" || (navigator.userAgent.indexOf('Opera Mini') > -1) || (navigator.userAgent.indexOf('OperaMini') > -1) || !!window['operamini']);

Opera Mini 4.5

On Google Chrome device emulator it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment