Skip to content

Commit 245d600

Browse files
committed
Improving docs about different browser sizes
1 parent 87fdf18 commit 245d600

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,37 @@ Then the log will contain the CDP session, for example:
117117
...
118118
```
119119

120+
### Setting Viewport Size
121+
122+
Control the browser viewport dimensions for screenshots and page rendering:
123+
124+
**Via connection URL (recommended):**
125+
126+
When running from in thedocker-compose.yml of changedetection.io project.
127+
( https://github.com/dgtlmoon/changedetection.io/blob/dev/docker-compose.yml#L21 )
128+
```
129+
- PLAYWRIGHT_DRIVER_URL=ws://browser-sockpuppet-chrome:3000/?--window-size=1920,1080
130+
```
131+
132+
Or configured from inside the changedetection.io interface as a [**Extra Browsers**] from the settings tab. (when run from the same docker-compose.yml)
133+
134+
<img src=docs/cdio-config-extra-browsers.png alt="Setup and choose mobile browser and other dimensions">
135+
136+
Then you can select the viewport size you like in the browser for checking the web-page for changes.
137+
138+
<img src=docs/cdio-browser-selection.png alt="Choosing a different size browser for checking a page for changes.">
139+
140+
141+
**Or, via environment variables:**
142+
143+
You can run this container with a different default size.
144+
145+
```bash
146+
docker run -e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 --security-opt seccomp=$(pwd)/chrome.json -p 127.0.0.1:3000:3000 dgtlmoon/sockpuppetbrowser
147+
```
148+
149+
If neither is specified, Chrome will use its default viewport size.
150+
120151
### Tuning
121152

122153
Some tips on high-concurrency scraping and tuning where you have a lot of chrome browsers running simultaneously

docs/cdio-browser-selection.png

94.5 KB
Loading
153 KB
Loading

0 commit comments

Comments
 (0)