Skip to content

Commit f495cdd

Browse files
committed
fixed
1 parent 907a3d6 commit f495cdd

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/tools/pages.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
// import fs from 'node:fs';
8+
// import path from 'node:path';
9+
710
import {logger} from '../logger.js';
811
import {zod} from '../third_party/index.js';
912

@@ -217,6 +220,22 @@ export const resizePage = defineTool({
217220
windowId,
218221
});
219222

223+
if (bounds.windowState === 'fullscreen') {
224+
// have to call this twice when window is in fullscreen mode
225+
await client.send('Browser.setWindowBounds', {
226+
windowId,
227+
bounds: {windowState: 'normal'},
228+
});
229+
await client.send('Browser.setWindowBounds', {
230+
windowId,
231+
bounds: {windowState: 'normal'},
232+
});
233+
} else if (bounds.windowState !== 'normal') {
234+
await client.send('Browser.setWindowBounds', {
235+
windowId,
236+
bounds: {windowState: 'normal'},
237+
});
238+
}
220239
await page.resize({
221240
contentWidth: request.params.width,
222241
contentHeight: request.params.height,

0 commit comments

Comments
 (0)