-1

I want to make my site not to work on uc browser using HTML or JavaScript is there any way to do it?

  • What have u tried? Any research? any code? – reisdev Dec 05 '18 at 02:22
  • Possible duplicate of [Javascript: How to detect if the user is using UC Browser/Mini?](https://stackoverflow.com/questions/38089868/javascript-how-to-detect-if-the-user-is-using-uc-browser-mini) – Nick Parsons Dec 05 '18 at 02:24

2 Answers2

0

Sadly, you're mostly out of luck. You can check for the user-agent that the browser sends, but that information is subject to modification by the user and could well be spoofed.

You can take a look at it in the navigator.userAgent variable in JavaScript and wipe the page with window.document.write("") if you don't like what you see. If the user decides to change the user-agent header sent by their browser there's nothing you can really do.

Some fingerprinting methods that don't rely on the user-agent exist, but they're generally only available on the server-end of things.

nitowa
  • 1,079
  • 2
  • 9
  • 21
0

Using JavaScript, we can use 'navigator.userAgent' to get information about the user's browser's name, version, platform, etc.

EDIT: I should add that this isn't secure.

You can read more about it here:

https://www.w3schools.com/jsref/prop_nav_useragent.asp

You can check the result against the list here: https://developers.whatismybrowser.com/useragents/explore/software_name/uc-browser/

The most popular version of UC Browser returns this as it's navigator.userAgent:

"Mozilla/5.0 (Linux; U; Android 6.0.1; zh-CN; F5121 Build/34.0.A.1.247) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.5.1.944 Mobile Safari/537.36"

You can search the returned string for "UCBrowser".