In Javascript, how do I determine if my current browser is Firefox on a computer vs everything else?

后端 未结 13 1857
萌比男神i
萌比男神i 2020-12-01 07:13
if(firefox and is on a computer){
alert(\'using firefox on a computer\')
}else{
alert(\"using something else!\");
}

How can I do this?

13条回答
  •  离开以前
    2020-12-01 07:51

    typeof InstallTrigger !== 'undefined'
    

    It's simple and works well after Quantum but not sure whether this will be future-proof though: https://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger

提交回复
热议问题