Drag'n drop cause crash browser tab

AI-generated summary

A user reports that drag-and-drop file uploads cause browser tab crashes in Chromium-based browsers after updating Discourse, while other upload methods work fine. The issue does not occur in Firefox or on other Discourse forums. MrIgareshka notes no errors in the Discourse logs but finds relevant errors in Chrome’s debug logs, indicating a security restriction related to unsecured origins. MrIgareshka identifies the root cause as Chromium’s blocking of insecure connections and suggests solutions: using an SSL certificate or enabling the #unsafe-treat-insecure-origin-as-secure flag in Chrome’s flags.

After update Discourse to last version I noticed that when I trying to drag any file to the page it causes an error.

This error appears in all browsers on the Chromium engine, but does not appear in Mozilla Firefox.

Other ways to upload files to the site, for example, through the button Upload or CTRL+V work correctly.

How can this problem be solved?

Screenshots

Hello and welcome @MrIgareshka :slight_smile:

I’ve just tried this myself on my test site and I don’t think I can replicate? Are there any errors in your /logs? And can you replicate this issue on try.discourse.org?

Thank you for your hospitality :slight_smile:

This problem only occurred to me. There is no such problem on other Discourse forums.

Nothing appears in the error log, the web page crashes before the image is uploaded to the site.

I have successfully uploaded the image to the site in Firefox and there is nothing in the Discourse error log either. I tried uploading files to the site In safe mode without plugins and themes, but the tab still crashes.

I checked on three browsers with the Chromium engine and this problem occurs everywhere. So I tried to run Chrome in debug mode and this is what is written in the logs

Chrome_logs

[15000:9236:0121/190159.718:ERROR:render_process_host_impl.cc(5167)] Terminating render process for bad Mojo message: Received bad user message: File System Access access from Unsecure Origin
[15000:9236:0121/190159.718:ERROR:bad_message.cc(29)] Terminating renderer for bad IPC message, reason 123

I’m starting to give up because I can’t find anything useful in the logs. Maybe someone can help. Thanks.

In Chromium updates, unsecured connections are automatically blocked without the ability to enable certain options. Therefore, when trying to use Drag’n’drop, the browser has no way to access the clipboard, so the page crashes.

The solution is to use an SSL certificate.

Or you can solve this problem by enabling the #unsafe-treat-insecure-origin-as-secure flag in the settings chrome://flags/ and adding the resource to the list.