mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +00:00
WebContent: Wait for same-URL WebDriver navigations to complete
The spec says we don't need to await navigations if we navigate to the same URL that we are already on, but at least in our implementation, we should still await the page load. Otherwise, we will invoke WebDriver endpoints on the wrong page.
This commit is contained in:
parent
cbf8f1495c
commit
13fe3477ab
Notes:
github-actions[bot]
2024-10-10 08:42:37 +00:00
Author: https://github.com/trflynn89
Commit: 13fe3477ab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1706
1 changed files with 4 additions and 1 deletions
|
@ -276,7 +276,10 @@ Messages::WebDriverClient::NavigateToResponse WebDriverConnection::navigate_to(J
|
|||
current_top_level_browsing_context()->page().load(url);
|
||||
|
||||
// 8. If url is special except for file and current URL and URL do not have the same absolute URL:
|
||||
if (url.is_special() && url.scheme() != "file"sv && current_url != url) {
|
||||
// AD-HOC: We wait for the navigation to complete regardless of whether the current URL differs from the provided
|
||||
// URL. Even if they're the same, the navigation queues a tasks that we must await, otherwise subsequent
|
||||
// endpoint invocations will attempt to operate on the wrong page.
|
||||
if (url.is_special() && url.scheme() != "file"sv) {
|
||||
// a. Try to wait for navigation to complete.
|
||||
TRY(wait_for_navigation_to_complete());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue