chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

[Chrome Runtime] Impossible to use window.open during page load #3785

Closed max3163 closed 1 month ago

max3163 commented 2 months ago

Describe the bug

With the Chrome Runtime, when I try to make a window.open during the load of a page, it doesn't work for 5-15 seconds.

To Reproduce

Start load this page :


<!DOCTYPE html>
<html lang="en">
  <head>

  </head>
  <body>
    <script>
      let count = 0;
      function openWindowRec() {
        console.log("Try window.open : " + count );
        if (!window.open('', 'ID321')) {
          setTimeout(() => {
            count++;
            openWindowRec();
          }, 500)
        }
      }
      console.log("First call openWindowRec" );
      openWindowRec();
    </script>
  </body>
</html>

Expected behavior

The same behaviour of the ALLOY Runtime, the open.window work on the first call and enter in the OnBeforePopup method...

Versions (please complete the following information):

Additional context

No problem with Chrome.

vav-dev commented 2 months ago

Same problem here with CefSharp Winform: window.open() does not work immediately in the page loading.

Only work around is to use the legacy Alloy bootstrap

max3163 commented 2 months ago

Any news about this issues ? Don't hesite if you have problem to reproduct it.

It's a blocking ticket for me.

max3163 commented 1 month ago

I'm just trying the 128 release, and the problem is still here ...

image

1-2sec before you can call the method....

When I use the ALLOW, it work on the first call as expected :

image

I use CefSharp to test the problem ( with the minimal project CefSharp.MinimalExample ) ( no custom code ). I first open a ticket on this project but they closed it and asked to open a new one on CEF project because the Runtime is handle by CEF project.

Pls, someone can help us ????

Sangarane commented 1 month ago

Same problem here !

max3163 commented 1 month ago

I note, on google chrome it work perfectly

image

max3163 commented 1 month ago

Ok, I've made a test with the CefClient Sample Application and it work ....

So the problem is on CefSharp ....