How to determine the Opera browser using JavaScript

后端 未结 6 911
清歌不尽
清歌不尽 2020-12-14 17:09

I want to determine that the browser of the client machines in Opera or not using JavaScript, how to do that?

6条回答
  •  情歌与酒
    2020-12-14 17:52

    The navigator object contains all the info you need. This should do:

    navigator.userAgent.indexOf("Opera");
    

提交回复
热议问题