Skip to content

Commit ca6ab31

Browse files
authored
fix(edge): be ready for non-windowed pages (#40071)
1 parent 9a99e0c commit ca6ab31

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • packages/playwright-core/src/server/chromium

packages/playwright-core/src/server/chromium/crPage.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,13 @@ class FrameSession {
441441
if (!this._page.isStorageStatePage && hasUIWindow &&
442442
!this._crPage._browserContext._browser.isClank() &&
443443
!this._crPage._browserContext._options.noDefaultViewport) {
444-
const { windowId } = await this._client.send('Browser.getWindowForTarget');
445-
this._windowId = windowId;
444+
try {
445+
const { windowId } = await this._client.send('Browser.getWindowForTarget');
446+
this._windowId = windowId;
447+
} catch {
448+
// Some pages in Edge, like internal UIs, are mis-classified as "page", but do
449+
// not actually have a browser window. That's fine, we won't resize them.
450+
}
446451
}
447452

448453
if (this._isMainFrame() && hasUIWindow && !this._page.isStorageStatePage)

0 commit comments

Comments
 (0)