
This prevents a flash of unstyled content. Our workaround is to add a temporary element for the imported stylesheet we're trying to reload, wait 200ms to make sure WebKit loads the new file, then remove and recreate the rule. Modifying a CSS rule to reference a not-yet-cached file causes WebKit to lose all document styles, so we have to apply a workaround that causes a lag. Live reloading of imported stylesheets has a 200ms lag.
USING GUARD LIVERELOAD INSTALL
Including livereload.js into your Browserify bundle probably makes no sense, because livereload.js isn't something you would ship to production.īut if you insist and you know what you're doing, you can install LiveReload via npm: npm install livereload-js -saveĪnd then add this to your bundle: window.LiveReloadOptions = This gives you a component containing a single script file, dist/livereload.js. Installation: bower install livereload-js -save-dev (But, to reiterate: the preferred method is to avoid installing it altogether, and instead use the one bundled with your LiveReload server/app/tool.) Live image reloading (, background-image and border-image properties, both inline and in stylesheets).We require LiveReload server vendors to distribute livereload.js as part of their apps or tools.Īn old version of this script is also bundled with the LiveReload browser extensions, but it's not getting updated and only serves for compatibility with very old clients. If you are developing a LiveReload server, see dist/livereload.js for the latest version built using the sources in this repository. It gets change notifications from a LiveReload server and applies them to the browser.

This repository contains a JavaScript file implementing the client side of the LiveReload protocol.

interested in hacking on livereload.js or want to understand it better.using a server that doesn't document the usage of livereload.js.

When your server is running, you can typically access the script at. Most LiveReload server vendors will serve livereload.js on the LiveReload port. You should use the copy of livereload.js script bundled with your server, because it's guaranteed to be compatible, and may be customized for that server. If you are a web developer looking to use LiveReload, you should refer to your LiveReload server/app/tool's documentation, rather that this repository.

To use LiveReload, you need a client (this script) in your browser and a server running on your development machine. LiveReload is a tool for web developers and designers.
