How to determine the Opera browser using JavaScript
问题 I want to determine that the browser of the client machines in Opera or not using JavaScript, how to do that? 回答1: The navigator object contains all the info you need. This should do: navigator.userAgent.indexOf("Opera"); 回答2: Now that Opera uses the Chrome rendering engine, the accepted solution no longer works. The User Agent string shows up like this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36 OPR/15.0.1147.132