chromiumembedded / cef

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

Visual Content fails to load after upgrading from CEF Version 119.4.30 to CEF Version 120.1.80 #3668

Closed Spartan-Hex-Shadow closed 6 months ago

Spartan-Hex-Shadow commented 6 months ago

Describe the bug

Visual Content fails to load after upgrading from CEF Version 119.4.30 to CEF Version 120.1.80 due to CORS change that was made between CEF Version 119.4.30 and 120.1.80, resulting in the following error:

Access to XMLHttpRequest at 'https://bla.ashx/') from origin 'https://bla.bla.com/' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.", source: https://bla.blob.com/delivery/?keycode=5XRRXMGY (0)

To Reproduce

  1. Create a basic winforms app.
  2. Make a request to a third party API which then routes you to a CDN to grab content from

Snippets attached:

Program.cs [STAThread] public static void Main() { CefSettings settings = new CefSettings(); // settings.CefCommandLineArgs.Add("disable-web-security", "true"); Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); Console.WriteLine($"Initialized settings: {Cef.IsInitialized}"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }

Form1.Designer.cs private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1920, 1080); this.Text = "Form1"; try { var browser = new ChromiumWebBrowser("www.google.com"); Controls.Add(browser); browser.LoadUrl("https://bla.blob.com/delivery/?keycode=5XRRXMGY"); } catch (Exception e) { Console.WriteLine(JsonConvert.SerializeObject(e)); } }

Expected behavior Request does not return a CORS error and loads content

Versions (please complete the following information):

Additional context Does the problem reproduce with the cefclient or cefsimple sample application at the same version?

magreenblatt commented 6 months ago

You claim that the problem does not reproduce with Google Chrome. Please provide reproduction steps that can be tested in Google Chrome and the CEF Sample Application.

magreenblatt commented 6 months ago

Marking as WontFix due to lack of reporter response.

Spartan-Hex-Shadow commented 6 months ago

@magreenblatt sorry for the no response. As the content with which this issue was triggered is secure, we are working on acquiring a public version and we'll be able to paste the url here that can be used by the CEF team. Should i open a new issue then?

magreenblatt commented 6 months ago

Should i open a new issue then?

No need, this looks like a duplicate of #3675