Skip to content

Commit

Permalink
Add --no-block-ads flag (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
jopemachine and sindresorhus authored Feb 3, 2022
1 parent e7b26e5 commit 6291705
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const cli = meow(`
--overwrite Overwrite the destination file if it exists
--inset Inset the screenshot relative to the viewport or \`--element\`. Accepts a number or four comma-separated numbers for top, right, left, and bottom.
--clip Position and size in the website (clipping region). Accepts comma-separated numbers for x, y, width, and height.
--no-block-ads Disable ad blocking
Examples
$ capture-website https://sindresorhus.com --output=screenshot.png
Expand Down Expand Up @@ -191,6 +192,10 @@ const cli = meow(`
inset: {
type: 'string',
},
blockAds: {
type: 'boolean',
default: true,
},
},
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
],
"dependencies": {
"arrify": "^3.0.0",
"capture-website": "^2.2.0",
"capture-website": "^2.3.0",
"get-stdin": "^9.0.0",
"meow": "^10.1.2",
"split-on-first": "^3.0.0"
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ $ capture-website --help
--overwrite Overwrite the destination file if it exists
--inset Inset the screenshot relative to the viewport or \`--element\`. Accepts a number or four comma-separated numbers for top, right, left, and bottom.
--clip Position and size in the website (clipping region). Accepts comma-separated numbers for x, y, width, and height.
--no-block-ads Disable ad blocking
Examples
$ capture-website https://sindresorhus.com --output=screenshot.png
Expand Down Expand Up @@ -91,6 +92,7 @@ $ capture-website --help
--inset=10,15,-10,15
--inset=30
--clip=10,30,300,1024
--no-block-ads
```

## FAQ
Expand Down
1 change: 1 addition & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ test('check flags', async t => {
--dark-mode
--inset=10,-15,-15,25
--clip=10,30,300,1024
--no-block-ads
`;

flags = flags.trim()
Expand Down
1 change: 1 addition & 0 deletions test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Generated by [AVA](https://avajs.dev).
password: 'password',
username: 'username',
},
blockAds: false,
clickElement: 'button',
clip: {
height: 1024,
Expand Down
Binary file modified test.js.snap
Binary file not shown.

0 comments on commit 6291705

Please sign in to comment.