dgtlmoon / dgtlmoon/changedetection.io

[feature] Abiilty to set window size with Playwright

Open
#1,499 7 comments 2 reactions 1 assignee Claimed by @dgtlmoon View on GitHub
enhancement
Dominant language
Python
Stars
34.1k
Forks
2k
Avg merge
23h 38m
Merged PRs (30d)
67

Description

**Describe the bug**
When Playwright is enabled and screen size is set as env variables these values are ignored.
```
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1024
```

Also by adding them as launch options with `--window-size=1920,1080` doesn't solve the issue, because each time the fetcher runs it manually set page size to 1280 x 720 [here](https://github.com/dgtlmoon/changedetection.io/blob/6e71088cde5f6e8c8fd24909a931877d9e032e56/changedetectionio/content_fetcher.py#L476)

**Version**
Docker compose

**To Reproduce**

Steps to reproduce the behavior:
1. Enable PLAYWRIGHT_DRIVER_URL and playwright-chrome service from the docker compose
2. Enable SCREEN_WIDTH or height to a custom value
3. Set a new job with Playwright fetch method to a website that checks webpage size, for example: https://browsersize.com/
4. See screenshot with 1280 x 720 size

**Expected behavior**
Custom set windows size

**Screenshots**
![image](https://user-images.githubusercontent.com/26493496/228088364-08465bb9-7571-47d5-a2b2-8405aa4b8fc4.png)

**Additional context**
The implementation should be configured here:
https://github.com/dgtlmoon/changedetection.io/blob/6e71088cde5f6e8c8fd24909a931877d9e032e56/changedetectionio/content_fetcher.py#L476

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.