Closed RodolfoSilva closed 3 months ago
Right now, the workaround I've found is to set a global window size with:
chrome_args: "--window-size=375,375"
I was wondering if there is a better way to achieve this result without setting a global value. @maltoe do you have any suggestion?
Hi @RodolfoSilva,
no, there's no option to set the screen size per job. The full_page
option comes close, setting the screen size to the content size, see here. If you'd like to give it a try, you could start from there. Option could be something like {:device_metrics_override, [width: ..., height: ...]}
.
@RodolfoSilva I've pushed a PR that allows to more easily run custom protocols - something I've been wanting to do for a while. A custom protocol would allow you to execute whatever devtools commands you want before the actual PDF printing. I've included an example for your use-case in the tests :point_up:. As stated in the PR description, I'd consider the Protocol
behaviour & the macros still to be internal API, but it's unlikely they're going to change anytime soon.
Still open for a :device_metrics_override
option if you're willing to work on that instead, though.
Thanks @maltoe, this solves my issue
Released as v1.17
Hi guys,
I need to know if it is possible and how I can set the page size to take a screenshot. Right now,
capture_screenshot/2
does not have an example of how we can define the screen widget.