Alejandro Sanz Díaz
Alejandro Sanz Díaz

Reputation: 8542

Activate liveReload monitoring chrome-extension in google chrome launching from bash

I'm trying to develope a bash script that launches google-chrome with a installed extension called LiveReload, which is used to monitor web changes. The point is when a web page is open you have to trigger LiveReload to start monitoring, and I want to do that automatically.

Is it possible?

Upvotes: 1

Views: 813

Answers (1)

Tripp Lilley
Tripp Lilley

Reputation: 1663

The most straightforward way is just to embed the livereload.js script directly in your page(s) during development:

<script src="js/vendor/livereload.js?host=localhost&port=32579"></script>

If you leave out the host and port params, LiveReload will infer them from the src attribute of the script tag. If you add the query param LR-verbose to the URL of your page (not the livereload.js tag), LiveReload will dump useful debugging info to the console attached to your page. E.g., http://localhost:8080/nextbigthing/ideas.html?LR-verbose

Since you're just manually loading the same file that the LiveReload extension would (either from its internal fallback copy, or from your LiveReload server), this behaves just as if you'd clicked the browser action button.

Upvotes: 2

Related Questions