当前位置:网站首页>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";
}
},边栏推荐
- System design. Short chain system design
- Unity2D horizontal version game tutorial 4 - item collection and physical materials
- Multiplication, DFS order
- Jetpack Compose学习(8)——State及remeber
- The level of ShardingSphere depots in actual combat (4)
- 221. 最大正方形
- RTL8720DN开发笔记一 环境搭建与mqtt实例
- tkinter模块高级操作(二)—— 界面切换效果、立体阴影字效果及gif动图的实现
- 关于Redis相关内容的基础学习
- ROS Action communication
猜你喜欢

The sword refers to offer17---print the n digits from 1 to the largest

九州云入选“可信云最新评估体系及2022年通过评估企业名单”

Xiaohei's leetcode journey: 104. The maximum depth of a binary tree

内网渗透——提权

勾股数元组 od js

tkinter模块高级操作(二)—— 界面切换效果、立体阴影字效果及gif动图的实现

typescript13 - type aliases

ROS Action通信

RTL8720DN开发笔记一 环境搭建与mqtt实例

typescript14-(单独指定参数和返回值的类型)
随机推荐
JS逆向之浏览器补环境(一)
《实战》基于电商领域的词性提取及其决策树模型建模
打印任务排序 js od华为
android的webview缓存相关知识收集
RTL8720DN开发笔记一 环境搭建与mqtt实例
手把手教你配置Jenkins自动化邮件通知
Centos 7.9安装PostgreSQL14.4步骤
数字图像隐写术之卡方分布
软件测试工作3年了,谈谈我是如何从刚入门进阶到自动化测试的?
Yolov7实战,实现网页端的实时目标检测
typescript13-类型别名
数字图像隐写术之JPEG 隐写分析
Teach you how to configure Jenkins automated email notifications
Basic Parameters of RF Devices 1
The sword refers to offer17---print the n digits from 1 to the largest
仿牛客网项目总结
4G通信模块CAT1和CAT4的区别
使用docker安装mysql
typescript10-常用基础类型
Typescript18 - object type