0

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?

3
  • 2
    You probably want to do feature detection instead of browser detection, unless you have a specific reason for actually needing to know the browser Commented Jun 13, 2017 at 8:32
  • 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. Commented Jun 13, 2017 at 8:53
  • Note that Opera Mini client doesn't run JavaScript. Commented Jun 13, 2017 at 9:46

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.