0
votes

I need to block specific script from execution over IOS opera mini browser.

navigator.UserAgent does not allow to clearly identify this browser. It returns somerhing like this: Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) OPiOS/8.0.0.78129 Mobile/11D201 Safari/9537.53

Ipad pro and iphone 5 se user agent not include nor 'opios' nor 'opr'

How to detect it correctly with javascript?

1
You probably want to do feature detection instead of browser detection, unless you have a specific reason for actually needing to know the browser - Patrick Evans
As @PatrickEvans said is better check feature detection, but if you want to check browser is better to test it with a regex some params, such as iPhone OS and OPiOS to avoid version changes. - dloeda
Note that Opera Mini client doesn't run JavaScript. - LS_ᴅᴇᴠ

1 Answers

0
votes

The Opera Mini user agent on iOS can be identified by the string 'OPiOS'.

It's not possible (to my knowledge) to reliably feature detect for Chrome vs Firefox vs Opera on iOS because they're all forced to use UIWebView or WKWebView, so the features one might attempt to detect differences in are all identical.

Chrome & Firefox have adopted the same pattern, using 'CriOS' and 'FxiOS' respectively.