当前位置:网站首页>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";
}
},
边栏推荐
- JPEG Steganalysis of Digital Image Steganography
- 87. Convert String to Integer
- 打印任务排序 js od华为
- C语言_结构体指针数组函数选票系统
- The client series of the DOM series
- Why use high-defense CDN when financial, government and enterprises are attacked?
- Mysql: Invalid default value for TIMESTAMP
- 查看zabbix-release-5.0-1.el8.noarch.rpm包内容
- 华为od 转骰子 js
- 射频器件的基本参数2
猜你喜欢
Jiuzhou Cloud was selected into the "Trusted Cloud's Latest Evaluation System and the List of Enterprises Passing the Evaluation in 2022"
小黑leetcode之旅:117. 填充每个节点的下一个右侧节点指针 II
typescript16-void
typescript16-void
ROS Action通信
typescript17-函数可选参数
Google官方控件ShapeableImageView使用
The sword refers to offer17---print the n digits from 1 to the largest
华为od 转骰子 js
Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar
随机推荐
TiDB 在长银五八消费金融核心系统适配经验分享
typescript14-(单独指定参数和返回值的类型)
ECCV 2022丨轻量级模型架构火了,力压苹果MobileViT(附代码和论文下载)
Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar
使用docker安装mysql
The Meta Metaverse Division lost 2.8 billion in the second quarter, still want to continue to bet?Metaverse development has yet to see a way out
小黑leetcode之旅:117. 填充每个节点的下一个右侧节点指针 II
typescript16-void
tkinter模块高级操作(二)—— 界面切换效果、立体阴影字效果及gif动图的实现
一万了解 Gateway 知识点
斩获BAT、TMD技术专家Offer,我都经历了什么?
解析云原生消息流系统 Apache Pulsar 能力及场景
The client series of the DOM series
ShardingSphere's vertical sub-database sub-table actual combat (5)
C language _ structure pointer array function voting system
MySQL (6)
【网络安全】文件上传靶场通关(1-11关)
RTL8720DN开发笔记一 环境搭建与mqtt实例
剑指offer17---打印从1到最大的n位数
Centos 7.9 install PostgreSQL14.4 steps