changedetection.io
changedetection.io copied to clipboard
[feature] Abiilty to set window size with Playwright
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
Version Docker compose
To Reproduce
Steps to reproduce the behavior:
- Enable PLAYWRIGHT_DRIVER_URL and playwright-chrome service from the docker compose
- Enable SCREEN_WIDTH or height to a custom value
- Set a new job with Playwright fetch method to a website that checks webpage size, for example: https://browsersize.com/
- See screenshot with 1280 x 720 size
Expected behavior Custom set windows size
Screenshots

Additional context The implementation should be configured here: https://github.com/dgtlmoon/changedetection.io/blob/6e71088cde5f6e8c8fd24909a931877d9e032e56/changedetectionio/content_fetcher.py#L476
I suggest to keep the windows size on changedetection application and remove the ENV variables set on the playwright-chrome service.
Also the size should be set with custom parameters in the settings as general and for each website as general or request option.

well its not that it 'doesnt work' , it's that it doesnt have that functionality, i'm open to PR
Yes and no, what is the point of setting the screen size in the docker compose if that behavior is ignored?
there was some early bug where it needed the window size set in order for the screenshot to work (from python), so that might be resolved now, i'm open to a PR if you want to remove it and test it
Related to https://github.com/dgtlmoon/changedetection.io/issues/1346
Wish to have that feature.