Question: frame/window size change
See original GitHub issueI’m looking up the chrome debugging protocol docs and seems like there’s not really a way to change the viewport size?
There’s Emulation.setVisibleSize
(https://chromedevtools.github.io/debugger-protocol-viewer/tot/Emulation/#method-setVisibleSize) but seems like it’s experimental
and doesn’t affect the frame’s container.
Looking at a way to do something like “change the width of the browser”, doesn’t have to be dynamic, can be set before we do any Page navigations. I read on another issue that you wouldn’t use CDP for something like this, but I believe that was more of dynamical resizing of the browser window size.
Maybe Emulation.forceViewport
(https://chromedevtools.github.io/debugger-protocol-viewer/tot/Emulation/#method-forceViewport)?
I’ve also tried Emulation.setDeviceMetricsOverride
, but didn’t seem to work.
I’m verifying by capturing screenshots, so maybe CDP works like PhantomJS where the screenshot viewport is not the same as frame viewport?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Try to open your issue here, https://github.com/ChromeDevTools/devtools-protocol/issues
@SerafinDinges: I did not. The screenshots were just for me to debug what was happening, I didn’t actually need it for production. It was hard to see what was happening with the default screenshot size but I made out what I could and inferred any missing information for what I wanted to do.