<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chrome | 酷 壳 - CoolShell</title>
	<atom:link href="https://coolshell.cn/tag/chrome/feed" rel="self" type="application/rss+xml" />
	<link>https://coolshell.cn</link>
	<description>享受编程和技术所带来的快乐 - Coding Your Ambition</description>
	<lastBuildDate>Thu, 19 Jan 2017 13:23:08 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>
	<item>
		<title>Chrome开发者工具的小技巧</title>
		<link>https://coolshell.cn/articles/17634.html</link>
					<comments>https://coolshell.cn/articles/17634.html#comments</comments>
		
		<dc:creator><![CDATA[陈皓]]></dc:creator>
		<pubDate>Thu, 19 Jan 2017 12:25:55 +0000</pubDate>
				<category><![CDATA[Web开发]]></category>
		<category><![CDATA[编程工具]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">http://coolshell.cn/?p=17634</guid>

					<description><![CDATA[<p>Chrome的开发者工具是个很强大的东西，相信程序员们都不会陌生，不过有些小功能可能并不为大众所知，所以，写下这篇文章罗列一下可能你所不知道的功能，有的功能可能...</p>
<p class="read-more"><a class="btn btn-default" href="https://coolshell.cn/articles/17634.html"> Read More<span class="screen-reader-text">  Read More</span></a></p>
The post <a href="https://coolshell.cn/articles/17634.html">Chrome开发者工具的小技巧</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></description>
										<content:encoded><![CDATA[<p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415450859608158"
     crossorigin="anonymous"></script>Chrome的开发者工具是个很强大的东西，相信程序员们都不会陌生，不过有些小功能可能并不为大众所知，所以，写下这篇文章罗列一下可能你所不知道的功能，有的功能可能会比较实用，有的则不一定，也欢迎大家补充交流。</p>
<p>话不多话，我们开始。</p>
<h4>代码格式化</h4>
<p>有很多css/js的代码都会被 minify 掉，你可以点击代码窗口左下角的那个 <strong><code>{ }</code></strong>  标签，chrome会帮你给格式化掉。</p>
<p><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17640" src="https://coolshell.cn/wp-content/uploads/2017/01/pretty-code.gif" alt="" width="707" height="319" /></p>
<p><span id="more-17634"></span></p>
<h4>强制DOM状态</h4>
<p>有些HTML的DOM是有状态的，比如&lt;a&gt; 标签，其会有 active，hover， focus，visited这些状态，有时候，我们的CSS会来定关不同状态的样式，在分析网页查看网页上DOM的CSS样式时，我们可以点击CSS样式上的 <strong><code>:hov</code></strong> 这个小按钮来强制这个DOM的状态。</p>
<p>&nbsp;</p>
<p><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17641" src="https://coolshell.cn/wp-content/uploads/2017/01/state.gif" alt="" width="853" height="331" /></p>
<p>&nbsp;</p>
<h4>动画</h4>
<p>现在的网页上都会有一些动画效果。在Chrome的开发者工具中，通过右上角的菜单中的 <code>More Tools</code> =&gt; <code>Animations</code> 呼出相关的选项卡。于是你就可以慢动作播放动画了（可以点选 <code>25%</code> 或 <code>10%</code>），然后，Chrome还可以帮你把动画录下来，你可以拉动动再画的过程，甚至可以做一些简单的修改。</p>
<p>&nbsp;</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17637" src="https://coolshell.cn/wp-content/uploads/2017/01/animation.gif" width="442" height="723" /></p>
<h4>直接编辑网页</h4>
<p>在你的 console 里 输入下面的命令：</p>
<p><code data-enlighter-language="js" class="EnlighterJSRAW">document.designMode = &quot;on&quot; </code></p>
<p>于是你就可以直接修改网页上的内容了。</p>
<p>P.S. 下面这个抓屏中还演示了一个如何清空console的示例。你可以输入 clear() 或是 按 <code>Ctrl+L</code>（Windows下），<code>CMD + K</code> (Mac下)</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17642" src="https://coolshell.cn/wp-content/uploads/2017/01/editor.gif" width="800" height="328" /></p>
<p>&nbsp;</p>
<h4>网络限速</h4>
<p>你可以设置你的网络的访问速度来模拟一个网络很慢的情况。</p>
<p><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17644" src="https://coolshell.cn/wp-content/uploads/2017/01/custom-network-throttling-profiles.gif" alt="" width="707" height="319" /></p>
<p>&nbsp;</p>
<h4>复制HTTP请求</h4>
<p>这个是我很喜欢 的一个功能，你可以在 network选项卡里，点击 XHR 过滤相关的Ajax请求，然后在相关的请求上点鼠标右键，在菜单中选择： <code>Copy</code> =&gt; <code>Copy as cURL</code>，然后就可以到你的命令行下去 执行 <code>curl</code> 的命令了。这个可以很容易做一些自动化的测试。</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17645" src="https://coolshell.cn/wp-content/uploads/2017/01/curl.gif" width="800" height="328" /></p>
<p>&nbsp;</p>
<p><strong>友情提示：这个操作有可能会把你的个人隐私信息复制出去，比如你个人登录后的cookie。</strong></p>
<h4>抓个带手机的图</h4>
<p>这个可能有点无聊了，不过我觉得挺有意思的。</p>
<p>在device显示中，先选择一个手机，然后在右上角选 <code>Show Device Frame</code>，然后你就看到手机的样子了，然后再到那个菜中中选 Capture snapshot，就可以抓下一个有手机样子的截图了。</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17646" src="https://coolshell.cn/wp-content/uploads/2017/01/device.gif" width="700" height="404" /></p>
<p>我抓的图如下（当然，不是所有的手机都有frame的）</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17647 size-medium" src="https://coolshell.cn/wp-content/uploads/2017/01/coolshell.cn-iPhone-6-Plus-1-148x300.png" width="148" height="300" srcset="https://coolshell.cn/wp-content/uploads/2017/01/coolshell.cn-iPhone-6-Plus-1-148x300.png 148w, https://coolshell.cn/wp-content/uploads/2017/01/coolshell.cn-iPhone-6-Plus-1-768x1559.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/coolshell.cn-iPhone-6-Plus-1-505x1024.png 505w, https://coolshell.cn/wp-content/uploads/2017/01/coolshell.cn-iPhone-6-Plus-1-133x270.png 133w, https://coolshell.cn/wp-content/uploads/2017/01/coolshell.cn-iPhone-6-Plus-1.png 780w" sizes="(max-width: 148px) 100vw, 148px" /></p>
<p>&nbsp;</p>
<h4>设置断点</h4>
<p>除了给Javascript的源代码上设置断点调试，你还可以：</p>
<h5>给DOM设置断点</h5>
<p>选中一个DOM，然后在右键菜单中选 Break on &#8230; 你可以看到如下三个选项：</p>
<h4><img decoding="async" loading="lazy" class="aligncenter wp-image-17665" src="https://coolshell.cn/wp-content/uploads/2017/01/break.dom_-1024x708.png" width="500" height="345" srcset="https://coolshell.cn/wp-content/uploads/2017/01/break.dom_-1024x708.png 1024w, https://coolshell.cn/wp-content/uploads/2017/01/break.dom_-300x207.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/break.dom_-768x531.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/break.dom_-391x270.png 391w, https://coolshell.cn/wp-content/uploads/2017/01/break.dom_.png 1152w" sizes="(max-width: 500px) 100vw, 500px" /></h4>
<h5>给XHR和Event Lisener设置断点</h5>
<p>在 Sources 面页中，你可以看到右边的那堆break points中，除了上面我们说的给DOM设置断点，你还可以给XHR和Event Listener设置断点，载图如下：</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17666" src="https://coolshell.cn/wp-content/uploads/2017/01/breakpoints-834x1024.png" width="400" height="491" srcset="https://coolshell.cn/wp-content/uploads/2017/01/breakpoints-834x1024.png 834w, https://coolshell.cn/wp-content/uploads/2017/01/breakpoints-244x300.png 244w, https://coolshell.cn/wp-content/uploads/2017/01/breakpoints-768x943.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/breakpoints-220x270.png 220w, https://coolshell.cn/wp-content/uploads/2017/01/breakpoints.png 906w" sizes="(max-width: 400px) 100vw, 400px" /></p>
<h4>关于Console中的技巧</h4>
<h5>DOM操作</h5>
<ul>
<li>chrome会帮你buffer 5个你查看过的DOM对象，你可以直接在Console中用 $0, $1, $2, $3, $4来访问。</li>
</ul>
<ul>
<li>你还可以使用像jQuery那样的语法来获得DOM对象，如：<code>$("#mydiv")</code></li>
</ul>
<ul>
<li>你还可使用 <code>$$(".class")</code> 来选择所有满足条件的DOM对象。</li>
</ul>
<ul>
<li>你可以使用 <code>getEventListeners($("selector"))</code> 来查看某个DOM对象上的事件（如下图所示）。</li>
</ul>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17656" src="https://coolshell.cn/wp-content/uploads/2017/01/events-geteventlisteners_expanded.png" width="642" height="223" srcset="https://coolshell.cn/wp-content/uploads/2017/01/events-geteventlisteners_expanded.png 842w, https://coolshell.cn/wp-content/uploads/2017/01/events-geteventlisteners_expanded-300x104.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/events-geteventlisteners_expanded-768x267.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/events-geteventlisteners_expanded-604x210.png 604w" sizes="(max-width: 642px) 100vw, 642px" /></p>
<ul>
<li>你还可以使用 <code>monitorEvents($("selector"))</code> 来监控相关的事件。比如：</li>
</ul>
<p><code data-enlighter-language="js" class="EnlighterJSRAW">monitorEvents(document.body, &quot;click&quot;);</code></p>
<p><img decoding="async" loading="lazy" class="aligncenter size-large wp-image-17661" src="https://coolshell.cn/wp-content/uploads/2017/01/monitor-events-1024x378.png" alt="" width="640" height="236" srcset="https://coolshell.cn/wp-content/uploads/2017/01/monitor-events-1024x378.png 1024w, https://coolshell.cn/wp-content/uploads/2017/01/monitor-events-300x111.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/monitor-events-768x283.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/monitor-events-604x223.png 604w, https://coolshell.cn/wp-content/uploads/2017/01/monitor-events.png 1302w" sizes="(max-width: 640px) 100vw, 640px" /></p>
<h5>Console中的一些函数</h5>
<p><strong>1）monitor函数</strong></p>
<p>使用 monitor函数来监控一函数，如下面的示例</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17657 size-medium" src="https://coolshell.cn/wp-content/uploads/2017/01/monitor-300x112.png" width="300" height="112" srcset="https://coolshell.cn/wp-content/uploads/2017/01/monitor-300x112.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/monitor-604x226.png 604w, https://coolshell.cn/wp-content/uploads/2017/01/monitor.png 706w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><strong>2）copy函数</strong></p>
<p>copy函数可以把一个变量的值copy到剪贴板上。</p>
<p><strong>3）inspect函数</strong></p>
<p>inspect函数可以让你控制台跳到你需要查看的对象上。如：</p>
<p><img decoding="async" loading="lazy" class="aligncenter size-large wp-image-17662" src="https://coolshell.cn/wp-content/uploads/2017/01/inspect-1024x459.png" alt="" width="640" height="287" srcset="https://coolshell.cn/wp-content/uploads/2017/01/inspect-1024x459.png 1024w, https://coolshell.cn/wp-content/uploads/2017/01/inspect-300x135.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/inspect-768x345.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/inspect-602x270.png 602w, https://coolshell.cn/wp-content/uploads/2017/01/inspect.png 1364w" sizes="(max-width: 640px) 100vw, 640px" /></p>
<p>更多的函数请参数官方文档 &#8211; <a href="https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference" target="_blank">Using the Console / Command Line Reference</a></p>
<h5>Console的输出</h5>
<p>我们知道，除了<code>console.log</code>之外，还有<code>console.debug</code>，<code>console.info</code>，<code>console.warn</code>，<code>console.error</code>这些不同级别的输出。另外一个鲜为人知的功能是，<code>console.log</code>中，你还可以对输出的文本加上css的样式，如下所示：</p>
<p><code data-enlighter-language="js" class="EnlighterJSRAW">console.log(&quot;%c左耳朵&quot;, &quot;font-size:90px;color:#888&quot;)</code></p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17651 size-medium" src="https://coolshell.cn/wp-content/uploads/2017/01/console.log_-300x92.png" width="300" height="92" srcset="https://coolshell.cn/wp-content/uploads/2017/01/console.log_-300x92.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/console.log_-768x236.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/console.log_-604x185.png 604w, https://coolshell.cn/wp-content/uploads/2017/01/console.log_.png 782w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>于是，你可以定义一些相关的log函数，如：</p>
<pre data-enlighter-language="js" class="EnlighterJSRAW">console.todo = function( msg){
  console.log( &#039;%c%s %s %s&#039;, &#039;font-size:20px; color:yellow; background-color: blue;&#039;, &#039;--&#039;, msg, &#039;--&#039;);
}
console.important = function( msg){
  console.log( &#039;%c%s %s %s&#039;, &#039;font-size:20px; color:brown; font-weight: bold; text-decoration: underline;&#039;, &#039;--&#039;, msg, &#039;--&#039;);
}</pre>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17652" src="https://coolshell.cn/wp-content/uploads/2017/01/console.log2_-1024x411.png" width="500" height="201" srcset="https://coolshell.cn/wp-content/uploads/2017/01/console.log2_-1024x411.png 1024w, https://coolshell.cn/wp-content/uploads/2017/01/console.log2_-300x121.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/console.log2_-768x309.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/console.log2_-604x243.png 604w, https://coolshell.cn/wp-content/uploads/2017/01/console.log2_.png 1140w" sizes="(max-width: 500px) 100vw, 500px" /></p>
<p>关于console.log中的格式化，你可以参看如下表格：</p>
<table class="t1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="td1" valign="middle">指示符</td>
<td class="td2" valign="middle">输出</td>
</tr>
<tr>
<td class="td3" valign="top">%s</td>
<td class="td4" valign="top">格式化输出一个字符串变量。</td>
</tr>
<tr>
<td class="td3" valign="top">%i or %d</td>
<td class="td4" valign="top">格式化输出一个整型变量的值。</td>
</tr>
<tr>
<td class="td3" valign="top">%f</td>
<td class="td4" valign="top">格式化输出一个浮点数变量的值。</td>
</tr>
<tr>
<td class="td3" valign="top">%o</td>
<td class="td4" valign="top">格式化输出一个DOM对象。</td>
</tr>
<tr>
<td class="td3" valign="top">%O</td>
<td class="td4" valign="top">格式化输出一个Javascript对象。</td>
</tr>
<tr>
<td class="td3" valign="top">%c</td>
<td class="td4" valign="top">为后面的字符串加上CSS样式</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>除了console.log打印js的数组，你还可以使用console.table来打印，如下所示：</p>
<pre data-enlighter-language="js" class="EnlighterJSRAW">var pets = [
  { animal: &#039;Horse&#039;, name: &#039;Pony&#039;, age: 23 },
  { animal: &#039;Dog&#039;, name: &#039;Snoopy&#039;, age: 13 },
  { animal: &#039;Cat&#039;, name: &#039;Tom&#039;, age: 18 },
  { animal: &#039;Mouse&#039;, name: &#039;Jerry&#039;, age: 12}
];
console.table(pets)</pre>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-17653" src="https://coolshell.cn/wp-content/uploads/2017/01/console.table_-1024x438.png" width="500" height="214" srcset="https://coolshell.cn/wp-content/uploads/2017/01/console.table_-1024x438.png 1024w, https://coolshell.cn/wp-content/uploads/2017/01/console.table_-300x128.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/console.table_-768x328.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/console.table_-604x258.png 604w, https://coolshell.cn/wp-content/uploads/2017/01/console.table_.png 1142w" sizes="(max-width: 500px) 100vw, 500px" /></p>
<p>&nbsp;</p>
<h4>关于console对象</h4>
<ul>
<li>console对象除了上面的打日志的功能，其还有很多功能，比如：</li>
<li>console.trace() 可以打出js的函数调用栈</li>
<li>console.time() 和 console.timeEnd() 可以帮你计算一段代码间消耗的时间。</li>
<li>console.profile() 和 console.profileEnd() 可以让你查看CPU的消耗。</li>
<li>console.count() 可以让你看到相同的日志当前被打印的次数。</li>
<li>console.assert(expression, object) 可以让你assert一个表达式</li>
</ul>
<p>这些东西都可以看看<a href="https://developers.google.com/web/tools/chrome-devtools/console/console-reference" target="_blank">Google的Console API的文档</a>。</p>
<p>其实，还有很多东西，你可以参看Google的官方文档 &#8211; <a href="https://developers.google.com/web/tools/chrome-devtools/" target="_blank">Chrome DevTools</a></p>
<h4>关于快捷键</h4>
<p>点击在 DevTools的右上角的那三个坚排的小点，你会看到一个菜单，点选 <code>Shortcuts</code>，你就可以看到所有的快捷键了</p>
<p><img decoding="async" loading="lazy" class="aligncenter size-large wp-image-17669" src="https://coolshell.cn/wp-content/uploads/2017/01/shortcuts-1024x466.png" alt="" width="640" height="291" srcset="https://coolshell.cn/wp-content/uploads/2017/01/shortcuts-1024x466.png 1024w, https://coolshell.cn/wp-content/uploads/2017/01/shortcuts-300x137.png 300w, https://coolshell.cn/wp-content/uploads/2017/01/shortcuts-768x350.png 768w, https://coolshell.cn/wp-content/uploads/2017/01/shortcuts-593x270.png 593w, https://coolshell.cn/wp-content/uploads/2017/01/shortcuts.png 1898w" sizes="(max-width: 640px) 100vw, 640px" /></p>
<p>如果你知道更多，也欢迎补充！</p>
<p>（全文完）<!--



<p align="center"><a href= target=_blank><img decoding="async" src=""></a></p>





<p align="center"><img decoding="async" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.weixin.jpg"> <img decoding="async" loading="lazy" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.mini_.jpg" width="300" height="300"> <br />关注CoolShell微信公众账号和微信小程序</p>

 

--></p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">酷 壳 &#8211; CoolShell</a> ，请勿用于任何商业用途）</strong></p>
</div>

<div class="wp_rp_wrap  wp_rp_vertical_m" id="wp_rp_first"><div class="wp_rp_content"><h3 class="related_post_title">相关文章</h3><ul class="related_post wp_rp"><li ><a href="https://coolshell.cn/articles/9666.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2013/05/Render-Process-150x150.jpg" alt="浏览器的渲染原理简介" width="150" height="150" /></a><a href="https://coolshell.cn/articles/9666.html" class="wp_rp_title">浏览器的渲染原理简介</a></li><li ><a href="https://coolshell.cn/articles/3684.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2011/02/1128-150x150.jpg" alt="Web开发人员速查卡" width="150" height="150" /></a><a href="https://coolshell.cn/articles/3684.html" class="wp_rp_title">Web开发人员速查卡</a></li><li ><a href="https://coolshell.cn/articles/6840.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2012/03/css-layouts-150x150.gif" alt="CSS 布局:40个教程、技巧、例子和最佳实践" width="150" height="150" /></a><a href="https://coolshell.cn/articles/6840.html" class="wp_rp_title">CSS 布局:40个教程、技巧、例子和最佳实践</a></li><li ><a href="https://coolshell.cn/articles/6043.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/30.jpg" alt="Web开发中需要了解的东西" width="150" height="150" /></a><a href="https://coolshell.cn/articles/6043.html" class="wp_rp_title">Web开发中需要了解的东西</a></li><li ><a href="https://coolshell.cn/articles/5537.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2011/11/stackparts.com_-150x150.png" alt="一些文章资源和趣闻" width="150" height="150" /></a><a href="https://coolshell.cn/articles/5537.html" class="wp_rp_title">一些文章资源和趣闻</a></li><li ><a href="https://coolshell.cn/articles/4795.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/7.jpg" alt="开源中最好的Web开发的资源" width="150" height="150" /></a><a href="https://coolshell.cn/articles/4795.html" class="wp_rp_title">开源中最好的Web开发的资源</a></li></ul></div></div>The post <a href="https://coolshell.cn/articles/17634.html">Chrome开发者工具的小技巧</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></content:encoded>
					
					<wfw:commentRss>https://coolshell.cn/articles/17634.html/feed</wfw:commentRss>
			<slash:comments>63</slash:comments>
		
		
			</item>
		<item>
		<title>浏览器正则表达式检查插件</title>
		<link>https://coolshell.cn/articles/2667.html</link>
					<comments>https://coolshell.cn/articles/2667.html#comments</comments>
		
		<dc:creator><![CDATA[陈皓]]></dc:creator>
		<pubDate>Tue, 20 Jul 2010 00:10:40 +0000</pubDate>
				<category><![CDATA[杂项资源]]></category>
		<category><![CDATA[编程工具]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[正则表达式]]></category>
		<guid isPermaLink="false">http://coolshell.cn/?p=2667</guid>

					<description><![CDATA[<p>以前本站介绍过一个在线的《正则表达式生成器》，下面是两个在浏览器中检查正则表达式的插件，Firefox的和Chrome的，希望对你有用。 1）Firefox：R...</p>
<p class="read-more"><a class="btn btn-default" href="https://coolshell.cn/articles/2667.html"> Read More<span class="screen-reader-text">  Read More</span></a></p>
The post <a href="https://coolshell.cn/articles/2667.html">浏览器正则表达式检查插件</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></description>
										<content:encoded><![CDATA[<p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415450859608158"
     crossorigin="anonymous"></script>以前本站介绍过一个在线的《<a rel="bookmark" href="https://coolshell.cn/articles/1830.html" target="_blank">正则表达式生成器</a>》，下面是两个在浏览器中检查正则表达式的插件，Firefox的和Chrome的，希望对你有用。</p>
<h3>1）Firefox：<a href="https://addons.mozilla.org/en-US/firefox/addon/2077/" target="_blank">Regular Expressions Tester</a></h3>
<figure style="width: 448px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" title="Firefox正规则表达式检查插件Regular Expressions Tester" src="http://sebastianzartner.de/new/resources/images/RExT/main.png" alt="" width="448" height="489" /><figcaption class="wp-caption-text">Firefox正规则表达式检查插件Regular Expressions Tester</figcaption></figure>
<h3></h3>
<h3>2）Chrome：<a href="https://chrome.google.com/extensions/detail/pgnkpcgniljiolidjmodgfljeomjjiha" target="_blank">Regular Expression Checker</a></h3>
<p><span id="more-2667"></span></p>
<p><figure style="width: 544px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" title="Chrome正规则表达式检查插件Regular Expression Checker" src="https://chrome.google.com/extensions/img/pgnkpcgniljiolidjmodgfljeomjjiha/1264182031.53/screenshot_big/2001" alt="" width="544" height="580" /><figcaption class="wp-caption-text">Chrome正规则表达式检查插件Regular Expression Checker</figcaption></figure><!--



<p align="center"><a href= target=_blank><img decoding="async" src=""></a></p>





<p align="center"><img decoding="async" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.weixin.jpg"> <img decoding="async" loading="lazy" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.mini_.jpg" width="300" height="300"> <br />关注CoolShell微信公众账号和微信小程序</p>

 

--></p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">酷 壳 &#8211; CoolShell</a> ，请勿用于任何商业用途）</strong></p>
</div>

<div class="wp_rp_wrap  wp_rp_vertical_m" ><div class="wp_rp_content"><h3 class="related_post_title">相关文章</h3><ul class="related_post wp_rp"><li ><a href="https://coolshell.cn/articles/17634.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2017/01/pretty-code-150x150.gif" alt="Chrome开发者工具的小技巧" width="150" height="150" /></a><a href="https://coolshell.cn/articles/17634.html" class="wp_rp_title">Chrome开发者工具的小技巧</a></li><li ><a href="https://coolshell.cn/articles/2936.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2010/09/Mozilla-150x150.jpg" alt="Mozilla的一个BUG" width="150" height="150" /></a><a href="https://coolshell.cn/articles/2936.html" class="wp_rp_title">Mozilla的一个BUG</a></li><li ><a href="https://coolshell.cn/articles/2704.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/8.jpg" alt="检查素数的正则表达式" width="150" height="150" /></a><a href="https://coolshell.cn/articles/2704.html" class="wp_rp_title">检查素数的正则表达式</a></li><li ><a href="https://coolshell.cn/articles/2367.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2010/04/URL-BAR-150x150.png" alt="谷歌Chrome取消&#8221;http://&#8221;" width="150" height="150" /></a><a href="https://coolshell.cn/articles/2367.html" class="wp_rp_title">谷歌Chrome取消&#8221;http://&#8221;</a></li><li ><a href="https://coolshell.cn/articles/2069.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2010/01/browser_history-150x150.jpg" alt="一个浏览器市场占有量的图" width="150" height="150" /></a><a href="https://coolshell.cn/articles/2069.html" class="wp_rp_title">一个浏览器市场占有量的图</a></li><li ><a href="https://coolshell.cn/articles/1830.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/8.jpg" alt="正则表达式生成器" width="150" height="150" /></a><a href="https://coolshell.cn/articles/1830.html" class="wp_rp_title">正则表达式生成器</a></li></ul></div></div>The post <a href="https://coolshell.cn/articles/2667.html">浏览器正则表达式检查插件</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></content:encoded>
					
					<wfw:commentRss>https://coolshell.cn/articles/2667.html/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>谷歌Chrome取消&#8221;http://&#8221;</title>
		<link>https://coolshell.cn/articles/2367.html</link>
					<comments>https://coolshell.cn/articles/2367.html#comments</comments>
		
		<dc:creator><![CDATA[陈皓]]></dc:creator>
		<pubDate>Thu, 22 Apr 2010 03:12:24 +0000</pubDate>
				<category><![CDATA[轶事趣闻]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTTP]]></category>
		<guid isPermaLink="false">http://coolshell.cn/?p=2367</guid>

					<description><![CDATA[<p>谷歌下一个版本的Chrome浏览器软件将缺少一个在近20年来一直是浏览器的一个特点的功能：在地址栏中的“http://”。目前开发人员版本的Chrome浏览器已...</p>
<p class="read-more"><a class="btn btn-default" href="https://coolshell.cn/articles/2367.html"> Read More<span class="screen-reader-text">  Read More</span></a></p>
The post <a href="https://coolshell.cn/articles/2367.html">谷歌Chrome取消”http://”</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></description>
										<content:encoded><![CDATA[<p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415450859608158"
     crossorigin="anonymous"></script>谷歌下一个版本的Chrome浏览器软件将缺少一个在近20年来一直是浏览器的一个特点的功能：在地址栏中的“http://”。目前开发人员版本的Chrome浏览器已经做了这种改变。这个变化虽然看起来很小，但是，已经在Chrome网站引起了程序员们很大的争议。</p>
<p><a href="https://coolshell.cn/wp-content/uploads/2010/04/URL-BAR.png"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-2373" title="Google Chrome 取消 http://" src="https://coolshell.cn/wp-content/uploads/2010/04/URL-BAR.png" alt="" width="343" height="183" srcset="https://coolshell.cn/wp-content/uploads/2010/04/URL-BAR.png 343w, https://coolshell.cn/wp-content/uploads/2010/04/URL-BAR-300x160.png 300w" sizes="(max-width: 343px) 100vw, 343px" /></a></p>
<p>在Google Chrome的开发站点上，又有了一个很热的BUG——<a href="http://code.google.com/p/chromium/issues/detail?id=41467" target="_blank">Issue  41467</a>（上一次的一热议的BUG是的《<a rel="bookmark" href="https://coolshell.cn/articles/1781.html" target="_blank">Go语言更名Issue 9</a>》），这个BUG目前已被关闭。不过在其它地方还在热议中，如：<a href="http://www.reddit.com/r/programming/comments/bt0oh/issue_41467_url_bar_no_longer_shows_http/" target="_blank">Reddit.com</a>。基本上来说，90%以上的程序员反对的，他们希望Google的Chrome可以给一个设置关闭或打开这一功能。</p>
<p>一些程序员觉得这是违反了RFC，并且觉得这是在向End User传播一种很不好的东西，那就是网址可以不用http://，这样一来会给程序员增加很多麻烦，比如：他们的程序无法使用http://这一关键字来检查用户的输出，等等。</p>
<p>iPhone浏览器的也是这样的， 不过当你把光标放到地址栏中，其会显示http://，广大程序员希望Chrome也实现这一方案。然而，<a href="http://code.google.com/p/chromium/issues/detail?id=41467" target="_blank">Issue  41467</a>目前的状态是“WontFix”，呵呵。</p>
<p>有人说，如果你在地址栏中直接输入网址，没有协议前缀，默认就是http://，Google用的就是这个特性，然后，你可以试试在地址栏中输入“<a rel="nofollow" href="ftp://ftp.gnu.org/gnu">ftp.gnu.org/gnu</a>”，你会发现，自动加入的不是http://而是ftp://，呵呵。</p>
<p>有人说，既然你要省，不如也把www.和后面的.com加上/也省了，因为这些都是默认的嘛。直接打google就OK了。Chrome开发团队说，没有www.和.com/只能算是一个主机名，不能算是DNS域名。呵呵。</p>
<p>还有人说，搞这种隐藏的最恶心的就是Windows，隐藏文件后缀名，隐藏系统文件，太扯了，于是，像sexy_girls.jpg.exe，huge-tits.jpg.src这样玩意儿让某些电脑知识薄弱意志不坚定的人深受其害。</p>
<p>如果有空，请留下你的观点。<!--



<p align="center"><a href= target=_blank><img decoding="async" src=""></a></p>





<p align="center"><img decoding="async" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.weixin.jpg"> <img decoding="async" loading="lazy" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.mini_.jpg" width="300" height="300"> <br />关注CoolShell微信公众账号和微信小程序</p>

 

--></p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">酷 壳 &#8211; CoolShell</a> ，请勿用于任何商业用途）</strong></p>
</div>

<div class="wp_rp_wrap  wp_rp_vertical_m" ><div class="wp_rp_content"><h3 class="related_post_title">相关文章</h3><ul class="related_post wp_rp"><li ><a href="https://coolshell.cn/articles/22398.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2023/02/chatgpt-150x150.jpg" alt="我看ChatGPT: 为啥谷歌掉了千亿美金" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22398.html" class="wp_rp_title">我看ChatGPT: 为啥谷歌掉了千亿美金</a></li><li ><a href="https://coolshell.cn/articles/22173.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/02/http_method-150x150.png" alt="“一把梭：REST API 全用 POST”" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22173.html" class="wp_rp_title">“一把梭：REST API 全用 POST”</a></li><li ><a href="https://coolshell.cn/articles/19840.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2019/10/HTTP-770x513-300x200-1-150x150.jpg" alt="HTTP的前世今生" width="150" height="150" /></a><a href="https://coolshell.cn/articles/19840.html" class="wp_rp_title">HTTP的前世今生</a></li><li ><a href="https://coolshell.cn/articles/18094.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2017/08/enable-https-banner-150x150.png" alt="如何免费的让网站启用HTTPS" width="150" height="150" /></a><a href="https://coolshell.cn/articles/18094.html" class="wp_rp_title">如何免费的让网站启用HTTPS</a></li><li ><a href="https://coolshell.cn/articles/17634.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2017/01/pretty-code-150x150.gif" alt="Chrome开发者工具的小技巧" width="150" height="150" /></a><a href="https://coolshell.cn/articles/17634.html" class="wp_rp_title">Chrome开发者工具的小技巧</a></li><li ><a href="https://coolshell.cn/articles/12136.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2014/11/inbox2-640x264-150x150.jpg" alt="Google Inbox如何跨平台重用代码？" width="150" height="150" /></a><a href="https://coolshell.cn/articles/12136.html" class="wp_rp_title">Google Inbox如何跨平台重用代码？</a></li></ul></div></div>The post <a href="https://coolshell.cn/articles/2367.html">谷歌Chrome取消”http://”</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></content:encoded>
					
					<wfw:commentRss>https://coolshell.cn/articles/2367.html/feed</wfw:commentRss>
			<slash:comments>35</slash:comments>
		
		
			</item>
	</channel>
</rss>
