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 bootstrap + Alloy style annoying popup bubble #3753

Closed BrianAndersonMozenda closed 3 months ago

BrianAndersonMozenda commented 4 months ago

Describe the bug Using Chrome bootstrap + Alloy style and in the OnBeforeDownload with Continue(downloadFilePath, false) to not show the "Save As" after the download is completed a "Show downloads when they're done" popup bubble appears. This seems inconsistent with the Alloy style which consistently reduces the noise of these types of bubbles.

To Reproduce Steps to reproduce the behavior:

  1. Change the cefclient OnBeforeDownload Continue callback parameter "showDialog" from true to false and provide a local path for the file to be downloaded to.
  2. Run cefclient with the alloy style by adding the --use-alloy-style command line parameter.
  3. Navigate to a site with a download file (something like https://www.thinkbroadband.com/download)
  4. Select 10 MB (small) button to download the test content
  5. Assert after the download is completed that a popup bubble doesn't appear

Expected behavior Expecting that the "Show downloads when they're done" popup bubble doesn't appear when using Alloy style.

Screenshots Popup Bubble: image

Versions (please complete the following information):

Additional context Does the problem reproduce with Google Chrome at the same version? This can be turned off in chrome://settings/downloads by toggling off "Show downloads when they're done".

Add any other context about the problem here. This bubble also pulls focus from the browser which is causing the injected JavaScript on the page to not be able to run properly. We are allowing our users to download multiple files from a page and this is blocking this from happening. After the first download completes the focus is pulled from the browser and the JS cannot initiate the subsequent downloads until the user manually "clicks" back into the browser area which allows it to regain focus.

magreenblatt commented 4 months ago

This can be turned off in chrome://settings/downloads by toggling off "Show downloads when they're done".

Chrome settings are also available in CEF, and can be configured programmatically.

BrianAndersonMozenda commented 4 months ago

Thank you - Can you point us to an example of how this is done in CEF?

BrianAndersonMozenda commented 3 months ago

Looks like I was able to change this behavior with the following preference:

CfxValue downloadsValue = CfxValue.Create();
downloadsValue.SetBool(false);
bool success = CfxRequestContext.GetGlobalContext().SetPreference("download_bubble.partial_view_enabled", downloadsValue, out string error);

This, however, didn't change the focus problem; After the download completes the focus is still pulled from the browser.