changedetection.io icon indicating copy to clipboard operation
changedetection.io copied to clipboard

[feature] Abiilty to set window size with Playwright

Open adripo opened this issue 2 years ago • 7 comments

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:

  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

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

adripo avatar Mar 27 '23 23:03 adripo

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.

adripo avatar Mar 27 '23 23:03 adripo

image

adripo avatar Mar 27 '23 23:03 adripo

well its not that it 'doesnt work' , it's that it doesnt have that functionality, i'm open to PR

dgtlmoon avatar Mar 28 '23 06:03 dgtlmoon

Yes and no, what is the point of setting the screen size in the docker compose if that behavior is ignored?

adripo avatar Mar 29 '23 00:03 adripo

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

dgtlmoon avatar Mar 29 '23 21:03 dgtlmoon

Related to https://github.com/dgtlmoon/changedetection.io/issues/1346

dgtlmoon avatar Apr 06 '23 09:04 dgtlmoon

Wish to have that feature.

MEL1H avatar Mar 13 '25 15:03 MEL1H