浏览器。浏览器对象检测、Chrome调试工具
chrome浏览器的flash问题: 2017-12-26 chrome浏览器的flash有无法显示无法正常运行的问题时,解决方法如下:
https://qzonestyle.gtimg.cn/qzone/photo/v7/js/module/flashDetector/flash_tutorial.pdf flash开启指引
chrome://settings/content/flash flash设置
浏览器对象检测
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript"> //javascript获取浏览器内核、版本函数
Browser = {
version: "",//版本
core: "",//内核
userAgent: "",//userAgent
init: function() {//初始化(遍历img,取出图片url,发ajax请求) var ua = navigator.userAgent.toLowerCase();
var s;
var name ='';
var ver = 0;
Browser.userAgent=ua; //探测浏览器
(s = ua.match(/msie ([\d.]+)/)) ? Browser._set("ie", Browser._setVersion(s[1])):
(s = ua.match(/firefox\/([\d.]+)/)) ? Browser._set("firefox", Browser._setVersion(s[1])) :
(s = ua.match(/chrome\/([\d.]+)/)) ? Browser._set("chrome", Browser._setVersion(s[1])) :
(s = ua.match(/opera.([\d.]+)/)) ? Browser._set("opera", Browser._setVersion(s[1])) :
(s = ua.match(/version\/([\d.]+).*safari/)) ? Browser._set("safari", Browser._setVersion(s[1])) : 0; },
_setVersion: function(ver,floatLength) {
ver = ('' + ver).replace(/_/g, '.');
floatLength = floatLength || 1;
ver = String(ver).split('.');
ver = ver[0] + '.' + (ver[1] || '0');
ver = Number(ver).toFixed(floatLength);
return ver;
},
_set: function(bname,bver) {
Browser.core=bname;
Browser.version=bver;
}
}; </script>
</head>
<body>
<h1>检测浏览器版本</h1> <div style="display:inline-block;border:1px solid #f90;background:#ffc;padding:10px 20px;">
<script type="text/javascript">
Browser.init();
document.write("<br><b>内核</b> "+Browser.core);//浏览器内核。
document.write("<br><b>版本</b> "+Browser.version);//浏览器版本。
document.write("<br><b>userAgent</b> "+Browser.userAgent);//浏览器信息。
</script>
</div> <style type="text/css">
body,div,p{font-size:14px;}
.red{color:red;}
b{font-style:bold;font-size:18px;color:#00f;margin-right:30px;}
h1{background:#adf;border:1px solid #09f;padding-left:20px;}
</style>
<h1>Screen 对象属性</h1> <script type="text/javascript">
document.write("<p><b>availWidth</b> 返回显示屏幕的宽度 (除 Windows 任务栏之外): <span class='red'>" + screen.availWidth + " </span></p>");
document.write("<p><b>availHeight</b> 返回显示屏幕的高度 (除 Windows 任务栏之外): <span class='red'>" + screen.availHeight + " </span></p>");
document.write("<p><b>bufferDepth</b> 设置或返回调色板的比特深度: <span class='red'>" + screen.bufferDepth + " </span></p>");
document.write("<p><b>colorDepth</b> 返回目标设备或缓冲器上的调色板的比特深度: <span class='red'>" + screen.colorDepth + " </span></p>");
document.write("<p><b>deviceXDPI</b> 返回显示屏幕的每英寸水平点数: <span class='red'>" + screen.deviceXDPI + " </span></p>");
document.write("<p><b>deviceYDPI</b> 返回显示屏幕的每英寸垂直点数: <span class='red'>" + screen.deviceYDPI + " </span></p>");
document.write("<p><b>fontSmoothingEnabled</b> 返回用户是否在显示控制面板中启用了字体平滑: <span class='red'>" + screen.fontSmoothingEnabled + " </span></p>");
document.write("<p><b>height</b> 返回显示屏幕的高度: <span class='red'>" + screen.height + " </span></p>");
document.write("<p><b>logicalXDPI</b> 返回显示屏幕每英寸的水平方向的常规点数: <span class='red'>" + screen.logicalXDPI + " </span></p>");
document.write("<p><b>logicalYDPI</b> 返回显示屏幕每英寸的垂直方向的常规点数: <span class='red'>" + screen.logicalYDPI + " </span></p>");
document.write("<p><b>pixelDepth</b> 返回显示屏幕的颜色分辨率(比特每像素): <span class='red'>" + screen.pixelDepth + " </span></p>");
document.write("<p><b>updateInterval</b> 设置或返回屏幕的刷新率: <span class='red'>" + screen.updateInterval + " </span></p>");
document.write("<p><b>width</b> 返回显示器屏幕的宽度: <span class='red'>" + screen.width + " </span></p>");
</script> <h1>Navigator 对象属性</h1>
<script type="text/javascript">
document.write("<p><b>appCodeName</b> 返回浏览器的代码名: <span class='red'>" + navigator.appCodeName + " </span></p>");
document.write("<p><b>appMinorVersion</b> 返回浏览器的次级版本: <span class='red'>" + navigator.appMinorVersion + " </span></p>");
document.write("<p><b>appName</b> 返回浏览器的名称: <span class='red'>" + navigator.appName + " </span></p>");
document.write("<p><b>appVersion</b> 返回浏览器的平台和版本信息: <span class='red'>" + navigator.appVersion + " </span></p>");
document.write("<p><b>browserLanguage</b> 返回当前浏览器的语言: <span class='red'>" + navigator.browserLanguage + " </span></p>");
document.write("<p><b>cookieEnabled</b> 返回指明浏览器中是否启用 cookie 的布尔值: <span class='red'>" + navigator.cookieEnabled + " </span></p>");
document.write("<p><b>cpuClass</b> 返回浏览器系统的 CPU 等级: <span class='red'>" + navigator.cpuClass + " </span></p>");
document.write("<p><b>onLine</b> 返回指明系统是否处于脱机模式的布尔值: <span class='red'>" + navigator.onLine + " </span></p>");
document.write("<p><b>platform</b> 返回运行浏览器的操作系统平台: <span class='red'>" + navigator.platform + " </span></p>");
document.write("<p><b>systemLanguage</b> 返回 OS 使用的默认语言: <span class='red'>" + navigator.systemLanguage + " </span></p>");
document.write("<p><b>userAgent</b> 返回由客户机发送服务器的 user-agent 头部的值: <span class='red'>" + navigator.userAgent + " </span></p>");
document.write("<p><b>userLanguage</b> 返回 OS 的自然语言设置: <span class='red'>" + navigator.userLanguage + " </span></p>");
</script> <h1>location 对象属性</h1>
<script type="text/javascript">
document.write("<p><b>hash</b> 设置或返回从井号 (#) 开始的 URL(锚): <span class='red'>" + location.hash + " </span></p>");
document.write("<p><b>host</b> 设置或返回主机名和当前 URL 的端口号: <span class='red'>" + location.host + " </span></p>");
document.write("<p><b>hostname</b> 设置或返回当前 URL 的主机名: <span class='red'>" + location.hostname + " </span></p>");
document.write("<p><b>href</b> 设置或返回完整的 URL: <span class='red'>" + location.href + " </span></p>");
document.write("<p><b>pathname</b> 设置或返回当前 URL 的路径部分: <span class='red'>" + location.pathname + " </span></p>");
document.write("<p><b>port</b> 设置或返回当前 URL 的端口号: <span class='red'>" + location.port + " </span></p>");
document.write("<p><b>protocol</b> 设置或返回当前 URL 的协议: <span class='red'>" + location.protocol + " </span></p>");
document.write("<p><b>search</b> 设置或返回从问号 (?) 开始的 URL(查询部分): <span class='red'>" + location.search + " </span></p>");
//document.write("<p><b>mmmmmmmmmm</b> mmmmmmmmm: <span class='red'>" + location.mmmmmmmm + " </span></p>"); </script> </body>
</html>
Chrome 前端调试工具:
Elements 元素
Console 慰问
Sources 来源
找到js文件,打上断点后F5刷新页面。F8是断点,F10是跳到下一步。
Network 网络
Network——>Disable cache 禁用缓存
Performance 性能
Memory 记忆
Application 应用
Security 安全
Audits 审核
浏览器。浏览器对象检测、Chrome调试工具的更多相关文章
- javascript跨浏览器事件对象类库
一.前言 学习了javascript事件后,个人总结归纳了跨浏览器事件对象类库,方便以后使用,现分享给大家. 二.事件对象封装 将对浏览器事件对象的操作封装成eventObject.js方便调用 // ...
- 各种浏览器的Hack写法(chrome firefox ie等)
Hack是针对不同的浏览器去写不同的CSS样式,从而让各浏览器能达到一致的渲染效果,那么针对不同的浏览器写不同的CSS CODE的过程,就叫CSS HACK,同时也叫写CSS Hack. 然后将Hac ...
- JS之路——浏览器window对象
window对象的方法 window.alert(msg) window.close() window.print() var a = window.setIntval(function,毫秒) // ...
- Android 浏览器内 H5 电脑 Chrome 调试
Android 浏览器内 H5 调试 chrome://inspect 移动前端调试方案(Android + Chrome 实现远程调试) adb 相关资源 adb shell(ADB Kits)下载 ...
- 建站手册-浏览器信息:Google Chrome 浏览器
ylbtech-建站手册-浏览器信息:Google Chrome 浏览器 1.返回顶部 1. http://www.w3school.com.cn/browsers/browsers_chrome.a ...
- 软件-浏览器-GoogleChrome:Google Chrome
ylbtech-软件-浏览器-GoogleChrome:Google Chrome Google Chrome是一款由Google公司开发的网页浏览器,该浏览器基于其他开源软件撰写,包括WebKit, ...
- chrome调试工具高级不完整使用指南(基础篇)
一.前言 本文记录的是作者在工作上面对chrome的一些使用和情况的分析分享,内容仅代表个人的观点.转发请注明出处(http://www.cnblogs.com/st-leslie/),谢谢合作 二. ...
- Chrome调试工具简单介绍
作为前端开发者都知道,快捷键F12可以打开chrome调试工具.firefox可以打开firebug工具.“工欲善其事,必先利其器”,对调试工具的掌握,能大大提高我们调试代码的效率.因为我平常chro ...
- 不常见但很有用的chrome调试工具使用方法
前面的话 对于chrome调试工具,常用的是elements标签.console标签.sources标签和network标签.但实际上,还有一些不太常见但相当实用的方法可以提高网页调试效率.本文将 ...
随机推荐
- BZOJ4899: 记忆的轮廓【概率期望DP】【决策单调性优化DP】
Description 通往贤者之塔的路上,有许多的危机. 我们可以把这个地形看做是一颗树,根节点编号为1,目标节点编号为n,其中1-n的简单路径上,编号依次递增, 在[1,n]中,一共有n个节点.我 ...
- JS校验 if (! temp_var) {} //拦截 ''和 undefined
if (! aaa) {} //拦截 ' ' 和 undefined 和 0 不拦截null
- Oracle 跨库 查询 复制表数据
在目前绝大部分数据库有分布式查询的需要.下面简单的介绍如何在oracle中配置实现跨库访问. 比如现在有2个数据库服务器,安装了2个数据库.数据库server A和B.现在来实现在A库中访问B的数据库 ...
- Oracle connect resource权限
connect resource权限:grant connect,resource to user;后用户包括的权限:CONNECT角色: --是授予最终用户的典型权利,最基本的ALTER SESSI ...
- vue-router 知识点
vue-router配置scrollBehavior 第三个参数 savedPosition 当且仅当 popstate 导航 (通过浏览器的 前进/后退 按钮触发) 时才可用. 注意: 这个功能只在 ...
- XFire构建web service客户端的五种方式
这里并未涉及到JSR 181 Annotations 的相关应用,具体的三种方式如下 ① 通过WSDL地址来创建动态客户端 ② 通过服务端提供的接口来创建客户端 ③ 使用Ant通过WSDL文件来生成客 ...
- Telnet 工具远程连接服务器
1.启动tomcat 2. 使用telnet命令 打开CMD,输入telnet localhost 8080 3.显示如下界面,说明已经连接成功 4. 复制如下代码到连接成功的界面 HEAD / ...
- 一组十六进制的字符串每两个转成对应值的byte
/// <summary> /// 一组十六进制的字符串每两个转成对应值的byte,比如4142 会成 AB对应的byte列表 /// </summary> /// <p ...
- 【python】单下划线与双下划线的区别
Python 用下划线作为变量前缀和后缀指定特殊变量. _xxx 不能用'from moduleimport *'导入 __xxx__ 系统定义名字 __xxx 类中的私有变量名 以单下划线开头(_f ...
- 性能计数器监控typeperf
获取性能计数器名称列表: typeperf -qx 监控: typeperf.exe "\JetByte TCP Stats Perf Counters Service\IPv4: ESTA ...