如何让 Firefox 在文件更改时自动刷新? [英] How do I make Firefox auto-refresh on file change?

查看:27
本文介绍了如何让 Firefox 在文件更改时自动刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道可以监控一个或多个本地文件的 Firefox 扩展、脚本或其他一些机制.当 Firefox 检测到文件中的(时间戳)更改时,它会自动刷新或以其他方式更新其画布.

对于编辑 CSS,最好只重新加载 CSS,而不是重新渲染完整的 HTML.

实际上,它可以通过动态 HTML/CSS 编辑实现与 Firebug 类似的行为,仅通过外部文件.

解决方案

Live.js

来自网站:

<块引用>

怎么样?只需包含 Live.js,它就会通过向服务器发送连续的 HEAD 请求来监视当前页面,包括本地 CSS 和 Javascript.对 CSS 的更改将动态应用,HTML 或 Javascript 更改将重新加载页面.试试吧!

在哪里?Live.js 可在 Firefox、Chrome、Safari、Opera 和 IE6+ 中运行,除非另有证明.Live.js 独立于您使用的开发框架或语言,无论是 Ruby、Handcraft、Python、Django、NET、Java、Php、Drupal、Joomla 还是您所拥有的.

它具有与 IETester 配合使用的巨大好处,可动态刷新每个打开的 IE 选项卡.

通过将以下内容添加到您的

来尝试一下

<script type="text/javascript" src="http://livejs.com/live.js"></script>

Does anyone know of an extension for Firefox, or a script or some other mechanism, that can monitor one or more local files. Firefox would auto-refresh or otherwise update its canvas when it detected a change (of timestamp) in the files(s).

For editing CSS, it would be ideal if just the CSS could be reloaded, rather than a full HTML re-render.

Effectively it would enable similar behaviour to Firebug with its dynamic HTML/CSS editing, only through external files.

解决方案

Live.js

From the website:

How? Just include Live.js and it will monitor the current page including local CSS and Javascript by sending consecutive HEAD requests to the server. Changes to CSS will be applied dynamically and HTML or Javascript changes will reload the page. Try it!

Where? Live.js works in Firefox, Chrome, Safari, Opera and IE6+ until proven otherwise. Live.js is independent of the development framework or language you use, whether it be Ruby, Handcraft, Python, Django, NET, Java, Php, Drupal, Joomla or what-have-you.

It has the huge benefit of working with IETester, dynamically refreshing each open IE tab.

Try it out by adding the following to your <head>

<script type="text/javascript" src="http://livejs.com/live.js"></script>

这篇关于如何让 Firefox 在文件更改时自动刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆