I am creating a website that is not rendered properly in UC Browser/Mini. I am planning to override the style using javascript. Thanks in advance.
Use the navigator.userAgent to see if either Opera Mini or UC Browser is being used.
The following example is how to detect if UCBrowser is being used
if (navigator.userAgent.indexOf(' UCBrowser/') >= 0) {
// do stuff here
}
The navigator.userAgent will return a list of stuff in string. Like the example above, navigation.userAgent will return a string of stuff where "UCBrowser" is included as the javascript is used in UC Browser. So the snippet above therefore indexes for such line and determine the condition should the indexed line be found in the userAgent output.
I am not sure whether this will work since I have trouble trying to test my local files on Opera Mini, but based on my research, the below code may work.
if (navigator.userAgent.indexOf('Opera Mini') >= 0) {
// do stuff here
}