grunt-reload-chrome0.1.4 • Public • Published
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-reload-chrome --save-dev
Reload Chrome task
Run this task with the
grunt reload command.
Task targets and options may be specified according to the grunt Configuring tasks guide.
This grunt tasks makes use of the chrome-remote-interface package.
So first Chrome needs to be started with the
--remote-debugging-port=<port> option to
enable the Remote Debugging Protocol, for example:
reload:homepage:options:url: ''match: /Chi/current:options:match: /Chi/eval:options:host: '192.168.1.23'port: 1024match: /Chi/scriptEvaluateOnLoad: 'alert("hi!")'
match you specify the title to match, it can be a regular expression or just an exact string. The tab must already be opened within your browser.
If you specify an
url, the location will be set to that exact url. If you
specify nothing the url will be replaced with itself causing it to reload the current page.
port can be used if your remote debugging port is something else than the default of
If you feel adventurous you can also use the
scriptEvaluateOnLoad option, to run a script each time the tab is
reloaded, which might come in handy to automate stuff even more.
Note: The detected tab will not reload if it has DevTools opened at the moment of reload.
- 2013-12-01 v0.1.4 Fix RegExp matching
- 2013-11-23 v0.1.3 expose scriptEvaluateOnLoad & proper tagging.
- 2013-11-23 v0.1.2 Forgot.
- 2013-11-23 v0.1.1 Forgot.
- 2013-11-22 v0.1.0 Initial version.