问题描述
我尝试过使用 navigator
,当然,它的确如此
我使用 alert(navigator.appName);
来确定浏览器并且我目前正在使用 Google Chrome
,当弹出窗口出现时,它显示 Mozilla
,但在 Mozilla
它可以正常工作,并且 Mozilla
它自己。
是否存在代码问题?或者它是一些错误?
要回答你的问题,不存在任何问题或错误。 Chrome将自己表现为Mozilla。查看Chrome提供的确切用户代理字符串。
以下是一些示例:
I have a problem in Determining Browsers.
I've tried using navigator
and well, it did not help.
I used alert(navigator.appName);
to determine the browser and I'm currently using Google Chrome
, when the pop up appears it displayed Mozilla
, but in Mozilla
it works fine and with Mozilla
It self.
is there a problem with the code? or it's some bug?
To answer your question, no there is no problem or bug. Chrome represents itself as Mozilla. See this for the exact User Agent strings which Chrome gives.
http://www.useragentstring.com/pages/useragentstring.php?name=Chrome
Here are some examples:
这篇关于使用javascript确定正在使用哪个浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!