浏览器。浏览器对象检测、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标签.但实际上,还有一些不太常见但相当实用的方法可以提高网页调试效率.本文将 ...
随机推荐
- Hibernate4.3配置
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hi ...
- hdu1208 dp
题意:给了一个 n * n 的方格图,要从图的左上角走到右下角 ,每次只能向右或者向下走,走的格数为当前格子上的数字,问共有多少中走法. 一开始我看到之后觉得这题完全可以用记忆化搜索来做,dfs 一遍 ...
- es6语法快速上手(转载)
一.相关背景介绍 我们现在大多数人用的语法javascript 其实版本是ecmscript5,也是就es5.这个版本己经很多年了,且完美被各大浏览器所支持.所以很多学js的朋友可以一直分不清楚es5 ...
- BL老师的建议,数学不好的,大数据一票否决--后赋从java转大数据
__________________________ 作者:我是蛋蛋链接:https://www.zhihu.com/question/59593387/answer/167235075来源:知乎著作 ...
- leetcode:Longest Common Prefix【Python版】
1.当strs为空,直接输出“” 2.当strs中含有“”,直接输出“” 3.strs[0]的最长长度由最短公共长度l决定(code line:15) class Solution: # @retur ...
- Entity Framework常用的查询方式
Entity Framework支持的查询方式有三种 LINQ to Entities Entity SQL Native SQL [LINQ to Entities] LINQ(语言集成查询)是从V ...
- 【MVC】Controller的使用
1,控制器中所有的动作方法必须声明为public,如声明为private或protected,将不被视为动作方法. 如果将Action声明为private,或者是添加[NonAction]属性,则不对 ...
- 廖雪峰 ---- Python教程
这是小白的Python新手教程,具有如下特点: 中文,免费,零起点,完整示例,基于最新的Python 3版本. Python是一种计算机程序设计语言.你可能已经听说过很多种流行的编程语言,比如非常难学 ...
- 在CentOS和RHEL中配置SNMPv3
首先,使用yum安装必要的软件 [root@server ~]# yum install net-snmp-utils net-snmp-devel安装完成之后, 先停止snmpd,再创建具有只读属性 ...
- 【转】每天一个linux命令(4):mkdir命令
原文网址:http://www.cnblogs.com/peida/archive/2012/10/25/2738271.html linux mkdir 命令用来创建指定的名称的目录,要求创建目录的 ...