chrome-devtools-protocol-screenshot
Advanced tools
Comparing version
@@ -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", |
15998
1.74%101
7.45%