快捷键

打开console界面快捷键:ctrl+shift+J

清空log:ctrl+L

选项

Log XMLHTTPRequests:显示ajax

Preserve log upon navigation:页面跳转时保留log

javascript方法

console.log:普通

console.info:=console.log

console.warn:警告

console.error:错误

console.count:输出被运行的次数,以参数分组计数

console.dir:把内容当作DOM或者javascript对象格式输出

console.dirxml:把内容输出为xml格式

console.assert:第一个参数为false时输出

console.trace:输出javascript调用栈

console.group:分组,可指定分组名

console.groupCollapsed:初始是折叠的分组开始标记

console.groupEnd:结束最近的分组,不接收参数

console.time:计时开始,传入参数为计时器名称

console.timeEnd:计时结束,必须与计时开始的计时器名称相同

console.timeStamp:在timeline视图中添加一个监控点

console.clear:清除控制台已经输出的log

debugger:在javascript设置断点

debugger;

占位符和输出格式

%s 字符串
%d, %i 数字
%f 浮点数
%o DOM元素(DOM的源代码)
%O javascript对象
%c

指定输出内容的样式,样式作为第二个参数传入

console.log("%cThis will be formatted with large, blue text", "color: blue; font-size: x-large");

控制台命令

clear:清除log

$():= document.querySelector()

$$():=document.querySelectorAll()

$x():XPath表达式

$_ :为最后一次通过$(),$$()或者$x()查询出来的结果

$0, $1, $2, $3 and $4:最后五次的查询结果

monitorEvents:监听事件,

monitorEvents(window, "resize");
monitorEvents(document.body, ["mousedown", "mouseup"]);
monitorEvents($('#scrollBar'), "touch"); //指定一个事件集的名字,同时监听 "touchstart", "touchend", "touchmove", 和 "touchcancel"
mouse "mousedown", "mouseup", "click", "dblclick", "mousemove", "mouseover", "mouseout", "mousewheel"
key "keydown", "keyup", "keypress", "textInput"
touch "touchstart", "touchmove", "touchend", "touchcancel"
control "resize", "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"

unmonitorEvents:取消监听事件

getEventListeners:返回指定对象上挂载的监听器

profile:开始收集javascript CPU profile,可以指定名称,同名多次的profile,会被分在同一组下

profileEnd:结束收集javascript CPU profile

copy:拷贝对象内容到剪贴板

dir:= console.dir

dirxml:= console.dirxml

inspect:输出DOM元素或者javascript对象

keys:输出对象的key的数组

values:输出对象的value的数组

chrome console cheat sheet的更多相关文章

  1. [Chromium文档转载,第006章]Chrome IPC To Mojo IPC Cheat Sheet

    For Developers‎ > ‎Design Documents‎ > ‎Mojo‎ > ‎ Chrome IPC To Mojo IPC Cheat Sheet 目录 1 O ...

  2. XSS Filter Evasion Cheat Sheet 中文版

    前言 译者注: 翻译本文的最初原因是当我自己看到这篇文章后,觉得它是非常有价值.但是这么著名的一个备忘录却一直没有人把它翻译成中文版.很多人仅仅是简单的把文中的 各种代码复制下来,然后看起来很刁的发在 ...

  3. XSS Cheat Sheet

    Basic and advanced exploits for XSS proofs and attacks. Work in progress, bookmark it. Technique Vec ...

  4. XSS Cheat Sheet(basics and advanced)

    XSS Cheat Sheet BASICS HTML注入 当输入位于HTML标记的属性值内或标记的外部(下一种情况中描述的标记除外)时使用.如果输入在HTML注释中,则在payload前加上&quo ...

  5. 转:PostgreSQL Cheat Sheet

    PostgreSQL Cheat Sheet CREATE DATABASE CREATE DATABASE dbName; CREATE TABLE (with auto numbering int ...

  6. Git Cheat Sheet

    Merge Undo git merge with conflicts $ git merge --abort Archive $ git archive --format zip --output ...

  7. CSS3 Animation Cheat Sheet:实用的 CSS3 动画库

    CSS3 Animation Cheat Sheet 是一组预设的动画库,为您的 Web 项目添加各种很炫的动画.所有你需要做的是添加样式表到你的网站,为你想要添加动画效果的元素应用预制的 CSS 类 ...

  8. XSS (Cross Site Scripting) Prevention Cheat Sheet(XSS防护检查单)

    本文是 XSS防御检查单的翻译版本 https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sh ...

  9. IOS Application Security Testing Cheat Sheet

    IOS Application Security Testing Cheat Sheet    [hide]  1 DRAFT CHEAT SHEET - WORK IN PROGRESS 2 Int ...

随机推荐

  1. 二、jenkins配置email(以腾讯企业qq为例)

    废话不多说,直接上干货: 主要针对两个部分进行介绍: 1.jenkins内置的邮件功能: 2.Editable Email Notification插件的邮件功能: 低版本的jenkins有很多插件都 ...

  2. [转] 基于C#的波形显示控件的实现

    转自 基于C#的波形显示控件的实现[附完整源码下载] 编者记: 09年暑假正好在学院实验室呆了一段时间,做了个完整的上位机软件(具体实现:根据下位机的指令,实现通过串口来操纵下位机进行实验,并将采集的 ...

  3. leetcode384

    public class Solution { private int[] nums; private Random random; public Solution(int[] nums) { thi ...

  4. PHP 数据集循环

    循环 $rs = $bbs->query("select top 10 * from tt"); while($row = $rs->fetch()) { //prin ...

  5. PHP 缓存插件之 Zend Opcache ( 取代 APC )

    简介: Zend Opcache .APC 这都是 PHP 代码加速器,将 PHP 源代码的编译结果缓存起来,再次调用时对比时间标记,如果没有改变则使用缓存数据,免去再次解析代码的开销. APC 止步 ...

  6. Maven使用Nexus私服的配置

    工作记录 —————————————————————————————— 配置文件 apache-maven-3.3.3\conf\settings.xml 在mirrors(镜像)之间配置. url为 ...

  7. /etc/rc5.d/s991local: line25: eject:command not found错误

      使用虚拟机安装centos出现错误,原因是我使用的镜像是最小级别的,没有图形化界面,只有终端窗口 有人用vmware安装minimal centos报错/etc/rc5.d/s99local : ...

  8. C# 文本文件的读写

    // *********************************************************************** // Assembly : XXX // Auth ...

  9. bootstrap-select用法详解

    首先需要引入 <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href=&quo ...

  10. 108.Convert Sorted Array to Binary Search Tree(Array; Divide-and-Conquer, dfs)

    Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 思路 ...