Save screenshots of your pages using SlimerJS
npm install grunt-slimer-screenshot> Save screenshots of any page using SlimerJS
~0.4.5If 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:
``shell`
npm install grunt-slimer-screenshot --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-slimer-screenshot');
The module uses SlimerJS for taking screenshots. If you have troubles with SlimerJS, refer to the project documentation page SlimerJS documentation.
#### The "slimer_screenshot" task
* 2016-02-01: (for version < 0.2.0)There seems to be a problem with the SlimerJS node package. Getting version 0.9.6 npm install -g slimerjs@0.9.6 seem to fix the problem.Cannot find mobule 'slimerjs'
* 2017-01-03: Fix for : https://github.com/laurentj/slimerjs/pull/565/files (fixed with slimerjs 0.10.3 and grunt-slimer-screenshot 0.2.0)SLIMERJSLAUNCHER environment variable does not contain an executable path
* 2017-01-03: Fix for : https://docs.slimerjs.org/current/installation.html
to the data object passed into grunt.initConfig().`js
grunt.initConfig({
slimer_screenshot: {
target: {
options: {
width: 600,
height: 600,
savingDir: "./screen/",
delay: 600
},
files: {
'shot1.png': 'https://google.com'
}
}
}
});
`$3
#### options.width
Type:
Number
Default value: 1024SlimerJS viewport width.
#### options.height
Type:
Number
Default value: 768SlimerJS viewport height.
#### options.savingDir
Type:
String
Default value: ./Folder where screenshots are saved.
#### options.delay
Type:
Number
Default value: 0Delay before taking screenshot.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.Release History
* 2016-06-16 v0.1.4 Initial version
* 2017-03-27 v0.2.0 Use of the SlimerJS package (0.10.3) as a dependency
* 2017-03-28 v0.2.1 Readme update
* 2018-06-13 v0.3.0 Upgraded to SlimerJS v1.0.0 - removed usage of XVFB for headless execution - use instead
--headless` for SlimerJS (available starting FF 56)