基线:全量源码首提(D1 版本控制落地,含第一轮优化 B1-B4/A1/A4/缩放修复)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# Browser Capability: viewport
|
||||
|
||||
Use an explicit viewport only for responsive or device-size testing. Otherwise keep the normal IAB viewport.
|
||||
|
||||
```js
|
||||
await tab.setViewportSize({ width: 1280, height: 720 });
|
||||
nodeRepl.write(JSON.stringify(tab.viewportSize()));
|
||||
```
|
||||
|
||||
`setViewportSize()` automatically opens the IAB responsive canvas. Its width and height are CSS pixels,
|
||||
and responsive mode uses DPR 1 so a viewport screenshot has matching PNG pixel dimensions. Exiting
|
||||
responsive mode in the UI clears the override and restores the host's natural DPR.
|
||||
Reference in New Issue
Block a user