Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
screenshot-phantom
Advanced tools
Timing screenshots on the websites and output pictures files in Node.js
Websites screenshots timer in Node.js
Regularly perform a screenshot task, the whole process of a task is: open the page => wait for resources to load => screenshots => close page => open the next page (if the screen at the same time multiple sites) ... ...
npm install --save screenshot-node
const screenshot = require('screenshot-node');
screenshot({
/*
* Required: An array consist of websites
*/
urls: [
'http://google.com',
'https://www.npmjs.com/'
],
/*
* Optional: Set the rule of screenshots timing
* Convenient options: 'everyMinute' | 'everyHour' | 'everyDay' | 'everyWeek' | 'everyMonth'
* or use the other options of package "node-schedule", such as '0 * * * * *' (see the "Links" for more details)
*/
rule: 'everyMinute',
/*
* Optional: Set the viewport width of screenshots
*/
width: 1024,
/*
* Optional: Set the viewport height of screenshots
*/
height: 768,
/*
* Optional: Set the screenshots format (pdf|png|jpeg)
*/
format: 'jpeg',
/*
* Optional: Set the time delay of screenshot after page loaded
*/
timeout: 15000,
/*
* Optional: Set the quality of the screenshots (0-100)
*/
quality: 75,
/*
* Optional: An array consist of screenshots files' prefix names that match the urls array by index, which means these two arrays have the same length
*/
picNamePrefix: [...urls],
/*
* Optional: Define the path of the output screenshots
*/
pathName: './pictures/'
});
const screenshot = require('screenshot-node');
screenshot({
urls: [
'http://google.com',
'http://www.bing.com/'
]
});
or
const screenshot = require('screenshot-node');
const schedule = require('node-schedule');
const rule = new schedule.RecurrenceRule();
rule.second = 0;
screenshot({
urls: [
'http://google.com',
'http://www.bing.com/'
],
rule
});
or
const screenshot = require('screenshot-node');
const rule = '0 * * * * *';
screenshot({
urls: [
'http://google.com',
'http://www.bing.com//'
],
rule
});
The same result:
const screenshot = require('screenshot-node');
const rule = '0 * * * * *';
screenshot({
urls: [
'http://google.com',
'http://www.bing.com/'
],
picNamePrefix: [
'Rose',
'Jack'
]
});
Result:
$ npm demo
https://github.com/node-schedule/node-schedule
Contributions welcome.
FAQs
Timing screenshots on the websites and output pictures files in Node.js
The npm package screenshot-phantom receives a total of 5 weekly downloads. As such, screenshot-phantom popularity was classified as not popular.
We found that screenshot-phantom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.