Fix allow_os_execution=true (fixes #2715, fixes #3851, fixes #3889)

When setting allow_os_execution=true in OnProtocolExecution the
confirmation dialog should display consistently, the load should
be canceled with ERR_ABORTED, and no interstitial error page
should be displayed.
This commit is contained in:
Marshall Greenblatt
2025-04-01 18:08:17 -04:00
parent 5b18ca7d3f
commit 70ea6f589f
6 changed files with 26 additions and 40 deletions

View File

@@ -1074,28 +1074,6 @@ void ClientHandler::OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
NotifyLoadingState(isLoading, canGoBack, canGoForward);
}
void ClientHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
ErrorCode errorCode,
const CefString& errorText,
const CefString& failedUrl) {
CEF_REQUIRE_UI_THREAD();
// Don't display an error for downloaded files.
if (errorCode == ERR_ABORTED) {
return;
}
// Don't display an error for external protocols that we allow the OS to
// handle. See OnProtocolExecution().
if (errorCode == ERR_UNKNOWN_URL_SCHEME) {
std::string urlStr = frame->GetURL();
if (urlStr.find("spotify:") == 0) {
return;
}
}
}
bool ClientHandler::OnRequestMediaAccessPermission(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,