js中怎么判断chrome浏览器

2024-10-16 03:15:31

1、先创建你的js判断界面,如图

js中怎么判断chrome浏览器

2、创建JavaScript节点来写js方法,如图

js中怎么判断chrome浏览器

3、使用navigator取得浏览器的userAgent字符串,如图

js中怎么判断chrome浏览器

4、判断userAgent字符串是否带有Chrome浏览器的标识,如图

js中怎么判断chrome浏览器

5、输出判断接口,如图

js中怎么判断chrome浏览器

6、使用不同的浏览器打开你新建的页面,如果是Chrome浏览器就显示true,其他的就显示false,如图

js中怎么判断chrome浏览器js中怎么判断chrome浏览器
猜你喜欢