当前位置:网站首页>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 隐写分析

typescript11 - data types

In Google Cloud API gateway APISIX T2A and T2D performance test

MySQL (6)

【952. Calculate the maximum component size according to the common factor】

typescript12-联合类型

设置浏览器滚动条样式

typescript11-数据类型

1782. Count the number of point pairs Double pointer

297. 二叉树的序列化与反序列化
随机推荐
VS warning LNK4099: No solution found for PDB
数字图像隐写术之卡方分布
剑指offer17---打印从1到最大的n位数
TiKV主要内存结构和OOM排查总结
Centos 7.9 install PostgreSQL14.4 steps
手把手教你配置Jenkins自动化邮件通知
基于Keras_bert模型的Bert使用与字词预测
typescript10-commonly used basic types
typescript12 - union types
PDF split/merge
87. 把字符串转换成整数
link与@import的区别
typescript15-(同时指定参数和返回值类型)
Bert usage and word prediction based on Keras_bert model
华为od 转骰子 js
RTL8720DN开发笔记一 环境搭建与mqtt实例
prometheus 监控概述
无线模块的参数介绍和选型要点
查看zabbix-release-5.0-1.el8.noarch.rpm包内容
手把手教你配置Jenkins自动化邮件通知