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

Javascript window.close() does not call DoClose #3761

Closed mbragg12 closed 3 months ago

mbragg12 commented 3 months ago

Describe the bug Starting with 126 window.close() from javascript no longer result in a call to DoClose.

To Reproduce Steps to reproduce the behavior:

  1. In cefsimple or cefclient, set a break point or add logging to the DoClose function so you can tell if it is called.
  2. Execute window.close() from javascript (see following for basic example html)
  3. Note DoClose is not called
<!DOCTYPE html><html lang="en"><head>
    <title>Doclose test</title>
</head>

<body>
    <script type="text/javascript">

</script>
    <script type="text/javascript">
        function closelink() {
            window.close();
        }
    </script>
    <div id="Content_Region">
        <div id="NoThanks_Link" class="bottomLeft"><a href="#" onclick="closelink();">
                <div class="noThanksButton">No, thanks</div>
            </a></div>
    </div>
</body></html>

Expected behavior Prior to 126, this would have resulted in a call to DoClose.

Versions (please complete the following information):

Additional context Uncertain if this is an expected change in behavior with the Chrome runtime changes. It's causing some issues with existing logic. Need to determine if changes are needed on our side or not.

magreenblatt commented 3 months ago

Are you using Chrome style or Alloy style? DoClose is not currently supported with Chrome style (see #3289).

mbragg12 commented 3 months ago

It's Chrome style. I kind of figured it was probably the expected behavior currently, but wasn't certain since that issue had been closed as completed. Thanks for the clarification.