Socket
Book a DemoInstallSign in
Socket

chrome-devtools-protocol-screenshot

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-devtools-protocol-screenshot - npm Package Compare versions

Comparing version

to
1.1.0

22

chrome-devtools-protocol-screenshot.js

@@ -97,13 +97,21 @@ #!/usr/bin/env node

for(b of program.breakPoints) {
await Emulation.setVisibleSize({
width: b,
height: originalDimentions.clientHeight,
});
if (program.breakPoints) {
for(b of program.breakPoints) {
await Emulation.setVisibleSize({
width: b,
height: originalDimentions.clientHeight,
});
const b64Img = await Page.captureScreenshot();
const buffer = new Buffer(b64Img.data, 'base64');
fs.writeFileSync(`${dir}/${b}.png`, buffer);
console.log(`wrote: ${dir}/${b}.png`);
}
} else {
const b64Img = await Page.captureScreenshot();
const buffer = new Buffer(b64Img.data, 'base64');
fs.writeFileSync(`${dir}/${b}.png`, buffer);
console.log(`wrote: ${dir}/${b}.png`);
fs.writeFileSync(`${dir}/out.png`, buffer);
console.log(`wrote: ${dir}/out.png`);
}

@@ -110,0 +118,0 @@

{
"name": "chrome-devtools-protocol-screenshot",
"repository": "tryggvigy/chrome-devtools-protocol-screenshot",
"version": "1.0.0",
"version": "1.1.0",
"description": "CLI tool to captures screenshots using chrome devtools protocol",

@@ -6,0 +6,0 @@ "bin": "./chrome-devtools-protocol-screenshot.js",

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.