当前位置:网站首页>pc端判断当前使用浏览器类型
pc端判断当前使用浏览器类型
2022-07-31 01:29:00 【Fansr_】
function getOpera() {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("Opera") > -1) {
//判断是否Opera浏览器
return "Opera";
}
if (userAgent.indexOf("Firefox") > -1) {
//判断是否Firefox浏览器
return "FF";
}
if (userAgent.indexOf("Chrome") > -1) {
//判断是否Chrome浏览器
return "Chrome";
}
if (userAgent.indexOf("Safari") > -1) {
//判断是否Safari浏览器
return "Safari";
}
if (
userAgent.indexOf("compatible") > -1 &&
userAgent.indexOf("MSIE") > -1 &&
!isOpera
) {
//判断是否IE浏览器
return "IE";
}
},边栏推荐
猜你喜欢

软件测试要达到一个什么水平才能找到一份9K的工作?

Teach you how to configure Jenkins automated email notifications

Huawei's "genius boy" Zhihui Jun has made a new work, creating a "customized" smart keyboard from scratch

ShardingSphere之垂直分库分表实战(五)

Parameter introduction and selection points of wireless module

In Google Cloud API gateway APISIX T2A and T2D performance test

Mysql:Invalid default value for TIMESTAMP

使用PageHelper实现分页查询(详细)

想要写出好的测试用例,先要学会测试设计

内网渗透——提权
随机推荐
Basic Parameters of RF Devices 1
297. 二叉树的序列化与反序列化
Unity2D horizontal version game tutorial 4 - item collection and physical materials
221. 最大正方形
android的webview缓存相关知识收集
Xiaohei's leetcode journey: 117. Fill the next right node pointer of each node II
九州云获评云计算标准化优秀成员单位
Typescript14 - (type) of the specified parameters and return values alone
1782. Count the number of point pairs Double pointer
typescript10-常用基础类型
调度中心xxl-Job
TiDB 在多点数字化零售场景下的应用
斩获BAT、TMD技术专家Offer,我都经历了什么?
Responsive layout vs px/em/rem
Zabbix干啥用?
Mysql:Invalid default value for TIMESTAMP
打印任务排序 js od华为
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
typescript18-对象类型
一万了解 Gateway 知识点