Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vague behaviour with execute async script and navigations #1856

Open
gsnedders opened this issue Nov 5, 2024 · 1 comment
Open

Vague behaviour with execute async script and navigations #1856

gsnedders opened this issue Nov 5, 2024 · 1 comment

Comments

@gsnedders
Copy link
Member

Partly motivated by web-platform-tests/wpt#48825:

What should be the behaviour of:

def test_window_navigates(session):
    session.url = "about:blank"
    response = execute_async_script(session, """
        let resolve = arguments[0];
        setTimeout(() => resolve(), 10000);
        location = "about:blank?new_url";
        """)
    assert_error(response, "script timeout")

Currently:

  • Firefox gives "javascript error"
  • Chrome gives "script timeout"
  • Safari gives "no such frame"

As far as I can tell, we should fall into:

If promise is still pending and timer's timeout fired flag is set, return error with error code script timeout.

…because the setTimeout call never calls its argument.

And thus the command should always take the current script timeout to complete. (It doesn't in any browser.)

This seems wrong, and we should move towards interop here.

@whimboo
Copy link
Contributor

whimboo commented Nov 5, 2024

This is a dupe of #1708, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants