Closed Bug 2002966 Opened 14 days ago Closed 1 day ago

All the configuration are not applied to browsing context created with window.open by the time the command returns

Categories

(Remote Protocol :: WebDriver BiDi, defect, P2)

defect
Points:
3

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Sasha, Assigned: Sasha)

References

(Blocks 4 open bugs)

Details

(Whiteboard: [webdriver:m18])

All the configurations (e.g. preload scripts, viewport, user agent overrides) which have to be applied to a new browsing context, are not being applied in time to browsing contexts, which are created with window.open. The settings are applied only after the window.open returns. Which is not what, e.g. Playwright, expects. The issue is probably the fact that we apply settings asynchronously when the window.open expects things to be done synchronously.

I wonder if the observation you made over on bug 2002721 comment 3 would help us. With DOMWindowCreated very early now should this give us time to sync the configuration and that the to be created browsing context will pick it up?

Points: --- → 3
Priority: -- → P2
Whiteboard: [webdriver:m18]
Assignee: nobody → aborovova
Status: NEW → ASSIGNED

From my research, Playwright sets all the emulations synchronously, which appears to be enough to set up the emulations before window.open returns. My experiment indicates that we can also achieve that. I would suggest splitting the work into 2 bugs:

  • Move the logic of applying user agent, locale, timezone, screen orientation, and screen settings configurations to the parent process;
  • Apply viewport settings for new browsing contexts before a browser element is attached.

All the related bugs are filed (see bug 2005546 and bug 2005558).

Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.