fix(browser): release attached viewport overrides without resizing the external page
Co-authored-by: dakjdakd <164857476+dakjdakd@users.noreply.github.com>
This commit is contained in:
@@ -288,11 +288,8 @@ const configureAttachedEnvironment = async (
|
||||
environment: BrowserScenario["environment"],
|
||||
signal: AbortSignal | undefined,
|
||||
): Promise<void> => {
|
||||
await page.setViewportSize({
|
||||
width: environment.viewport.width,
|
||||
height: environment.viewport.height,
|
||||
});
|
||||
throwIfScenarioCancelled(signal);
|
||||
// setViewportSize also resizes the external browser window. The scenario's
|
||||
// CDP metrics override below supplies the viewport and expires on disconnect.
|
||||
await page.emulateMedia({
|
||||
colorScheme: environment.color_scheme,
|
||||
reducedMotion: environment.reduced_motion,
|
||||
@@ -307,6 +304,7 @@ const configureAttachedEnvironment = async (
|
||||
height: environment.viewport.height,
|
||||
deviceScaleFactor: environment.viewport.device_scale_factor,
|
||||
mobile: false,
|
||||
dontSetVisibleSize: true,
|
||||
});
|
||||
throwIfScenarioCancelled(signal);
|
||||
await session.send("Emulation.setLocaleOverride", {
|
||||
|
||||
Reference in New Issue
Block a user