chromiumembedded/cef

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

Closed this issue · 7 comments

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):

  • OS: Windows 10
  • CEF Version: 126 and later ( Usine CefSharp )

Additional context

No problem with Chrome.

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

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

It's a blocking ticket for me.

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 ????

Same problem here !

I note, on google chrome it work perfectly

image

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

So the problem is on CefSharp ....

I believe the solution was to disable the popup blocker. More details at cefsharp/CefSharp#4940 (comment)