Skip to content

Commit

Permalink
Remove UWB custom load error page. It shows the default chrome one now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Voltstro committed Oct 16, 2024
1 parent ba16d25 commit ae94dc0
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/UnityWebBrowser.Engine.Cef/Shared/Browser/UwbCefLoadHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,4 @@ protected override void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpSt

if (frame.IsMain) client.ClientControls.LoadFinish(url);
}

protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode,
string errorText, string failedUrl)
{
CefLoggerWrapper.Error(
$"An error occurred while trying to load '{failedUrl}'! Error details: {errorText} (Code: {errorCode})");

if (errorCode is CefErrorCode.Aborted
or CefErrorCode.BLOCKED_BY_RESPONSE
or CefErrorCode.BLOCKED_BY_CLIENT
or CefErrorCode.BLOCKED_BY_CSP)
return;

//TODO: We should move this to an internal scheme page thingy
string html =
$@"<style>
@import url('https://fonts.googleapis.com/css2?family=Ubuntu&display=swap');
body {{
font-family: 'Ubuntu', sans-serif;
}}
</style>
<h2>An error occurred while trying to load '{failedUrl}'!</h2>
<p>Error: {errorText}<br>(Code: {(int)errorCode})</p>";
client.LoadHtml(html);
}
}

0 comments on commit ae94dc0

Please sign in to comment.