[removed] How to find out if the user browser is Chrome?

后端 未结 15 1732
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 09:41

I need some function returning a boolean value to check if the browser is Chrome.

How do I create such functionality?

15条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 10:34

    all answers are wrong. "Opera" and "Chrome" are same in all cases.

    (edited part)

    here is the right answer

    if (window.chrome && window.chrome.webstore) {
        // this is Chrome
    }
    

提交回复
热议问题