WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
210 stars 135 forks source link

WPE 2.38 - Set URL fails #1334

Closed amol-virnodkar-infosys closed 1 week ago

amol-virnodkar-infosys commented 1 month ago

The Set URL fails on RPI4 Model B device

Test steps

  1. Launch the UIController using a browser
  2. Enable WebKitBrowser plugin using the Controller
  3. Select WebKitBrowser plugin in the UIController
  4. Set the Custom URL to http://mvt.onemw.net/test-materials/sandbox/navigation_test.html
  5. Get the current Browser URL
    root@raspberrypi4-64-rdk-android-mc:~# curl -d '{"method": "WebKitBrowser.1.url"}'  http://localhost:9998/jsonrpc
    \{"jsonrpc":"2.0","result":"http:\/\/mvt.onemw.net\/test-materials\/sandbox\/navigation_test.html#676"}
    root@raspberrypi4-64-rdk-android-mc:~# 
  6. Select WebKitBrowser plugin in the UIController, set the Custom URL to https://widgets.metrological.com/lightning/liberty/2e3c4fc22f0d35e3eb7fdb47eb7d4658#app:com.metrological.app.CNN
  7. Get the current Browser URL
    root@raspberrypi4-64-rdk-android-mc:~# curl -d '{"method": "WebKitBrowser.1.url"}'  http://localhost:9998/jsonrpc
    {"jsonrpc":"2.0","result":"http:\/\/mvt.onemw.net\/test-materials\/sandbox\/navigation_test.html#7372"}
    root@raspberrypi4-64-rdk-android-mc:~# 

Ideally after step 6, the current Browser URL should be set to https://widgets.metrological.com/lightning/liberty/2e3c4fc22f0d35e3eb7fdb47eb7d4658#app:com.metrological.app.CNN but the curl command in step 7 is returning the URL as http://mvt.onemw.net/test-materials/sandbox/navigation_test.html#7372

Note RDK6 comes with WPE 2.38 and we have used RDK6 image on RPI4 device. This issue is observed using the RDK6 image.

amol-virnodkar-infosys commented 1 month ago

Note: The source code of http://mvt.onemw.net/test-materials/sandbox/navigation_test.html consists of changeLocation() function which is called every 10ms.

<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>
pgorszkowski-igalia commented 1 month ago

I am able to reproduce the problem on RPi3 with wpe-2.38 and wpe-2.42 with WPEFramework. I use a local version of the test site with the same content as it is in http://mvt.onemw.net/test-materials/sandbox/navigation_test.html. Steps to reproduce:

  1. Launch the UIController using a browser
  2. Enable WebKitBrowser plugin using the Controller
  3. Select WebKitBrowser plugin in the UIController
  4. Set the Custom URL to http://localhost/navigation_test.html
  5. Set the Custom URL to https://www.igalia.com

After step 4 there is no possibility to switch to other site like https://www.igalia.com in step 5. It is not possible also with webinspector and window.location.href="https://www.igalia.com"

I am investigating the reason of that and possible solution.

magomez commented 1 month ago

Does this reproduce if the env var WPE_KEEP_NAVIGATION_ON_FRAGMENT_LOAD=1 is defined?. I think commit https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/525d2d60d8387773a023f7ae67c74c3b06430457 was added precisely to fix this problem.

pgorszkowski-igalia commented 1 month ago

It fixes partially the problem. But even then I can reproduce the problem with lower probability - still checking this.

amol-virnodkar-infosys commented 1 month ago

I tried setting the environment variable WPE_KEEP_NAVIGATION_ON_FRAGMENT_LOAD=1 and retested. With this change, there is some improvement seen but the issue was reproducible 5/10 times.

pgorszkowski-igalia commented 1 month ago

The issue I reported also in upstream and I am working on the fix: https://bugs.webkit.org/show_bug.cgi?id=274745

pgorszkowski-igalia commented 1 week ago

Hi @amol-virnodkar-infosys , can you check my patch from: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1354 and verify it works for you and that there are no regressions? thanks

Please remember to set WPE_KEEP_NAVIGATION_ON_FRAGMENT_LOAD=1.

amol-virnodkar-infosys commented 1 week ago

Hi @pgorszkowski-igalia,

We tested this patch: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1354 with env. variable WPE_KEEP_NAVIGATION_ON_FRAGMENT_LOAD=1 and this issue is not reproducible. There are no regressions seen due to this patch as well. Thanks.

pgorszkowski-igalia commented 1 week ago

Hi @amol-virnodkar-infosys, thanks for the feedback. In that case we will merge PR https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1354.

pgorszkowski-igalia commented 1 week ago

The fix is merged so we can close the ticket.