Bug 274745

Summary: API URL change request can be cancelled by JS navigation
Product: WebKit Reporter: Przemyslaw Gorszkowski <pgorszkowski>
Component: Page LoadingAssignee: Przemyslaw Gorszkowski <pgorszkowski>
Status: NEW ---    
Severity: Normal CC: achristensen, beidson, cdumez, cgarcia, karlcow, magomez, mcatanzaro, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Przemyslaw Gorszkowski 2024-05-27 00:59:59 PDT
Originally it was reported and observed in https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/1334, but the problem can be reproduced also with latest main. It can be reproduced with COG and cogctl(to sent API URL change request), WebKitGTK (minibrowser) or Safari. In case of Chrome or FireFox, I was not able to reproduce the problem.

The simple test case:
<html>
<head>
    <script>
        let i = 0;
        function changeLocation() {
            i += 1
            window.location.href = "#" + i;
            setTimeout(changeLocation, 10)
        }
        changeLocation()
    </script>
</head>
<body>
    Navigation test
</body>
</html>

Steps to reproduce:

1. Open "simple test case"
2. Try to navigate to some other site (e.g. https://www.igalia.com):
* by cogctl open https://www.igalia.com
* by click "home" button in WebKitGTK minibrowser
* by typing new site address in "address/URL bar" field

In case of Safari, COG, WebKitGTK the behaviour is not consistent, sometimes it is possible to open selected URL , sometimes the request is cancelled and we stay on the "simple test case" site.

In case of FF, Chrome we always navigate to new address.
Comment 1 Radar WebKit Bug Importer 2024-06-03 01:00:15 PDT
<rdar://problem/129151609>
Comment 2 Przemyslaw Gorszkowski 2024-06-10 03:51:02 PDT
Pull request: https://github.com/WebKit/WebKit/pull/29671