<?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>走走停停看看 &#187; 未分类</title>
	<atom:link href="http://shawphy.com/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://shawphy.com</link>
	<description>关注HTML,CSS,JavaScript,jQuery等前端开发</description>
	<lastBuildDate>Mon, 02 Jan 2012 09:47:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>文件保存后自动刷新浏览器页面</title>
		<link>http://shawphy.com/2010/02/auto-refresh-page-after-saving-file.html</link>
		<comments>http://shawphy.com/2010/02/auto-refresh-page-after-saving-file.html#comments</comments>
		<pubDate>Sun, 28 Feb 2010 15:44:37 +0000</pubDate>
		<dc:creator>Shawphy</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[前端开发]]></category>

		<guid isPermaLink="false">http://shawphy.com/?p=181</guid>
		<description><![CDATA[做前端的就是苦命，前端的键盘最苦命的是F5按键。 每次修改了点页面，写了点代码就要按F5去测试，着实让人崩溃。 除非用DreamWeaver这种工具，或者TopStyle这种，否则就免不了受罪。 这也归罪于微软各个GUI直接通信不良…… 今天找到个方案， 这位达人写了一个Firefox小扩展，用于修改js和host文件的时候用。 原理请参考上面的链接，我就拿来改了一改 敲击这里下载 注意：这个工具只是一个很原始的模型！！ 怎么用呢？ 很简单，在Firefox，打开你所要的页面，这个扩展会不停检测 D:\refresh.firefox 文件， 如果存在这个文件，他就会自动刷新当前页面并删除这个文件。 那么如何创建这个文件呢？ For VIM 如果你是用VIM的，在$MYVIMRC中加入这句话 function! b:AutoRefresh() &#160;&#160; &#160;!start cmd /c echo x &#62; d:\\refresh.firefox &#160;&#160; &#160;syntax on endfunction autocmd BufWritePost,FileWritePost *.html :call b:AutoRefresh() 其中 syntax on &#8230; <a href="http://shawphy.com/2010/02/auto-refresh-page-after-saving-file.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>做前端的就是苦命，前端的键盘最苦命的是F5按键。<br />
每次修改了点页面，写了点代码就要按F5去测试，着实让人崩溃。<br />
除非用DreamWeaver这种工具，或者TopStyle这种，否则就免不了受罪。<br />
这也归罪于微软各个GUI直接通信不良……</p>
<p>今天找到个方案， <a href="http://bluehua.org/2009/04/03/257.html">这位达人</a>写了一个Firefox小扩展，用于修改js和host文件的时候用。<br />
原理请参考上面的链接，我就拿来改了一改</p>
<p><a href="http://shawphy.googlecode.com/files/overlay.xpi">敲击这里下载</a></p>
<p><strong>注意：这个工具只是一个很原始的模型！！</strong></p>
<h3>怎么用呢？</h3>
<p>很简单，在Firefox，打开你所要的页面，这个扩展会不停检测 D:\refresh.firefox 文件，<br />
如果存在这个文件，他就会自动刷新当前页面并删除这个文件。</p>
<h3>那么如何创建这个文件呢？</h3>
<h4>For VIM</h4>
<p>如果你是用VIM的，在$MYVIMRC中加入这句话</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">function! b:AutoRefresh()</li>
<li>&nbsp;&nbsp; &nbsp;!start cmd /c echo x &gt; d:\\refresh.firefox</li>
<li>&nbsp;&nbsp; &nbsp;syntax on</li>
<li>endfunction</li>
<li>autocmd BufWritePost,FileWritePost *.html :call b:AutoRefresh()</li></ol></div>
<p>其中 syntax on 这句是为了可以不会出现一个等待键盘确认的事件。我是参考<a href="http://glacjay.is-a-geek.org/blog/archives/151">这里</a>的<br />
这就让html文件保存的时候生成d:\refresh.firefox文件了</p>
<h4>For Editplus</h4>
<p>如果你像我一样是Editplus用户的话，也很容易。如图<br />
<a href="http://shawphy.com/2010/02/auto-refresh-page-after-saving-file.html/editplus2refreash" rel="attachment wp-att-182"><img src="http://shawphy.com/wp-content/uploads/2010/02/editplus2refreash-300x245.png" alt="" title="editplus2refreash" width="300" height="245" class="alignnone size-medium wp-image-182" /></a><br />
设置Auto Run: After Save里的，添加命令就行了。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">cmd /c echo x &gt;d:\refresh.firefox</li></ol></div>
<p>只不过还是有点后遗症，随便什么文件保存它都会生成……<br />
作为一个不开源，没有插件体系，更新也很不勤快的编辑器……要求也不要太高了……<br />
友情提醒：请使用正版软件~可以在有能力的时候购买许可，或者转用其他开源编辑器，比如Notepad++等。不要让使用盗版成为国内软件开发人员的<a href="http://twitter.com/tinyfool/status/9227064084">原罪</a>……</p>
<h4>For Others</h4>
<p>基本原理都知道了，应该不难办了吧？</p>
<h3>系统资源占用</h3>
<p>实测下来，我E7200，CPU占用率不到1%。这个setInterval还是很节约资源的。</p>
<h3>带来的好处</h3>
<p>仔细想的话，节约的不只一步。你要切换窗口，要按f5，看效果，再切换回来继续调整。但如果你是宽屏或者是编辑器背景透明的话，无需切换就可以完成了。节约的是大把时间。如果是虚拟机或者其他电脑测试的情况下，也可以用局域网共享实现，非常好用。其他浏览器只要提供访问文件的接口，也可以如法炮制。</p>
]]></content:encoded>
			<wfw:commentRss>http://shawphy.com/2010/02/auto-refresh-page-after-saving-file.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

