feat: support device scale factor in --viewport#1141
feat: support device scale factor in --viewport#1141Aalivexy wants to merge 2 commits intoChromeDevTools:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@Lightning00Blade could you please review? |
Lightning00Blade
left a comment
There was a problem hiding this comment.
After checking the implementation - I think we can't use this approach as this set the ViewPort only for a single page, which will be reset upon navigation and some other cases as well.
A better approach would be to set the Chrome argument --force-device-scale-factor=X as that will force everything to scale with that factor accordingly.
Summary
This PR updates the server CLI --viewport flag to reuse the existing viewport syntax used by emulation tools.
--viewportnow accepts both:1280x7201280x720x2When a device scale factor is provided, it is applied during browser startup in addition to the initial viewport size.
Changes
<width>x<height>x<deviceScaleFactor><width>x<height>formatdeviceScaleFactorduring initial browser launchreslove #1140