w3c / w3c/webdriver

Handle the case where a navigation happens during script execution

Open
#1,708 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Execute Async Script Execute Script needs-discussion
Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Description

Let completion be Function.[[Call]](window, parameters) with function as the this value.

During this step a navigation can happen which will prevent the function completing and so prevent the command ever returning. For async scripts the situation is even worse because the navigation can occur any time before the completion callback is called.

We should explicitly state somewhere that if the browsing context becomes inactive during script execution then we respond with a Javascript Error (or maybe No Such Window?)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the script-execution completion step described in this issue and trace how navigation affects synchronous and asynchronous script execution. Decide whether the specified response should be Javascript Error or No Such Window, then update the relevant WebDriver specification text and verify that both execution cases are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.