Unreal seems to be hard coded to block file dialogs?

So, purchased this plugin for 5.3 to open pdfs. Great plugin, has an ‘open’ button that lets you pick a file with a file dialog. Saw the demo of it working, but when I tried it I got this error saying ‘Filedialogs are prevented’ I managed to find this error in one function, but it seems strange, because it seems like this function is set up to always block them and I can’t seme to find any way in the project settings to enable them.

Here is the function:

bool FCEFWebBrowserWindow::OnFileDialog(CefDialogHandler::FileDialogMode Mode, const CefString& DialogTitle, const CefString& DefaultFilePath, const std::vector<CefString>& AcceptFilters, int SelectedAcceptFilter, CefRefPtr<CefFileDialogCallback> Callback)
{
	// This would prevent a file dialog from opening.
	UE_LOG(LogWebBrowser, Error, TEXT("FileDialogs are prevented."));
	return true;
}

Has anyone worked with this function before, or know a way (other than overriding it since this is launcher) to allow it to work? It’s bizarre that this is hardcoded to block.

This function is an interface for interacting with Chromium-based browsers.
It appears that its functionality was intentionally disabled in Unreal 5.4
According to commit patch that changed it, this was a security vulnerability.

You should probably report this issue to the plugin author.
It should still work on older Unreal versions though.

This is actually a pretty common tactic when you need to implement the interface but not all of it, you just provide a dummy function with some assert or error, so when the code needs to run it shows appropriate message instead of doing nothing.

References:

The code I just showed is from 5.3 so it doesn’t work on all older versions of Unreal. I’m not sure when the change was actually made.

Patches to vulnerabilities and critical issues are usually being applied into minor releases.
They’ve ported it to multiple releases starting from 5.3.1
That’s probably why you see it on your side.
Here’s the exact path in 5.3 branch: 983bc55f66844626fe47e137e8057123d90d133a

I don’t see this patch on the 5.2 though. It should still work on 5.2 and lower

yeah the OnFileDialog handler in the cef browser widget is stubbed out on purpose since that security patch, so there is no project setting that re-enables it. any dialog the pdf plugin tries to open through the browser widget stays dead, its not their bug to fix.

the workaround is to not rely on the browser widget’s dialog at all: pick the file first with a native os dialog, then load the url you build from that path into the web view. unreal keeps the file picker behind c++ though, and packaged builds expose even less of it, which is why most blueprint setups fall back to a hidden editable text box paste hack.

Async Runtime File Dialog, a native file picker plugin for Unreal Engine 5, gives blueprint async open/save/folder dialog nodes that work in packaged builds and dont block the game thread, then you feed the picked path into the pdf viewer: Async Runtime File Dialog — Native OS File Picker for Blueprints | Fab