mirror of
https://github.com/vladocar/screenshoteer.git
synced 2024-12-22 13:42:19 +01:00
New big update
This commit is contained in:
parent
a33214dfe1
commit
478a84cc0b
3 changed files with 17 additions and 3 deletions
|
@ -43,6 +43,8 @@ Parameters:
|
|||
--no - exclude "image", "stylesheet", "script", "font"
|
||||
--click - example: ".selector>a" excellent way to close popups or to click some buttons on the page.
|
||||
--file - output file name (optional, otherwise based on page title and timestamp)
|
||||
--theme - switch to dark or light color theme
|
||||
--vd - Emulate vision deficiency 'achromatopsia', 'deuteranopia', 'protanopia', 'tritanopia', 'blurredVision', and 'none'
|
||||
<p>
|
||||
|
||||
<h4>Example: </h4>
|
||||
|
@ -75,6 +77,10 @@ screenshoteer --url https://www.economist.com/ --click ".ribbon__close-button"
|
|||
screenshoteer --url file:///Users/../index.html
|
||||
|
||||
screenshoteer --url https://www.slashdot.org --file /tmp/slashdot.png
|
||||
|
||||
screenshoteer --url https://mxb.dev/blog/color-theme-switcher/ --theme dark
|
||||
|
||||
screenshoteer --url https://news.ycombinator.com --vd blurredVision
|
||||
```
|
||||
<p> List of of supported mobile devices: https://github.com/GoogleChrome/puppeteer/blob/master/DeviceDescriptors.js
|
||||
</p>
|
||||
|
|
8
index.js
Executable file → Normal file
8
index.js
Executable file → Normal file
|
@ -18,6 +18,8 @@ program
|
|||
.option('--no, [no]', 'Exclude')
|
||||
.option('--click, [click]', 'Click')
|
||||
.option('--file, [file]', 'Output file')
|
||||
.option('--theme, [theme]', 'Color Theme light or dark')
|
||||
.option('--vd, [vd]', 'Emulate vision deficiency')
|
||||
.parse(process.argv);
|
||||
|
||||
if (!program.url) {
|
||||
|
@ -58,6 +60,12 @@ console.log(program.fullPage);
|
|||
if (program.h && !program.fullpage) program.fullPage = false;
|
||||
await page.setViewport({width: Number(newWidth), height: Number(newHeight)})
|
||||
}
|
||||
if (program.theme) {
|
||||
await page.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: program.theme }]);
|
||||
}
|
||||
if (program.vd) {
|
||||
await page.emulateVisionDeficiency(program.vd);
|
||||
}
|
||||
if (program.emulate)
|
||||
await page.emulate(devices[program.emulate]);
|
||||
else
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
"name": "screenshoteer",
|
||||
"version": "1.0.9",
|
||||
"version": "1.1.0",
|
||||
"description": "Make screenshots and device emulations form your terminal",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"bin": {
|
||||
"screenshoteer": "./index.js"
|
||||
"screenshoteer": "index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "^2.19.0",
|
||||
"puppeteer": "^1.10.0"
|
||||
"puppeteer": "^4.00.0"
|
||||
},
|
||||
"keywords": [
|
||||
"screenshots",
|
||||
|
|
Loading…
Reference in a new issue