Some of the features from my website don't work on Opera Mini, but they work on Opera. Is there a way to tell difference between these two browsers in JavaScript, so that I could prevent people from accessing certain pages of my website?
I've tried window.navigator.userAgent.indexOf('Opera Mini/') but it also works for Opera... Object.prototype.toString.call(window.operamini) === "[object OperaMini]" doesn't work at all
Opera Mini use 3 modes for major platforms(iOS, Android):
OBLMOnly extreme mode is real Opera Mini, in other cases Opera Mini uses default browser engine, but with a additional letters
OPR/in user agent string.So you just need to check
window.operaminifor extreme mode andOPR/in user agent string for other modes.That's all. This is the only way.