Skip to content

asciidisco/firefox-element-screenshots

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

firefox-element-screenshots

Screenshots single elements from Webpages

Setup

$ npm install and you´re good to go.

Configuration

You can configure the pages and elements you want to screenshots within screenshots.config.js.

Each page needs an object within the export of the module which looks like this:

{
  url: 'http://drublic.de/',
  elements: {
    'navigation': '.site-navigation'
  }
}

This is the configuration that is on the top of the screenshotElements.js file. Please modify it if needed.

// Your firefox binary (this is the default on OSX)
var firefoxBinary = '/Applications/Firefox.app/Contents/MacOS/firefox-bin';

// Folder for screenshots
var screenshotFolder = 'shots';

Run

Important: The script itself needs to start Firefox, it must be closed. The script dies if FF is already open!

$ node screenshotElements.js

Screenshots will end up in the shots subdirectory.

About

Screenshots single elements from Webpages using Firefox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published