UI: Style the crash page and update error page image

- Modified the error page
- changed the error/crash page

Co-authored-by: notnotnescap <97590612+nescapp@users.noreply.github.com>
This commit is contained in:
SINF-KEN 2025-03-26 13:37:00 +01:00 committed by Sam Atkins
parent 002e79a658
commit 1a34676046
Notes: github-actions[bot] 2025-03-26 19:40:25 +00:00
2 changed files with 18 additions and 13 deletions

View file

@ -638,14 +638,19 @@ void ViewImplementation::handle_web_content_process_crash(LoadErrorPage load_err
if (load_error_page == LoadErrorPage::Yes) {
StringBuilder builder;
builder.append("<html><head><title>Crashed: "sv);
builder.append(escape_html_entities(m_url.to_byte_string()));
builder.append("</title></head><body>"sv);
builder.append("<h1>Web page crashed"sv);
if (m_url.host().has_value()) {
builder.appendff(" on {}", escape_html_entities(m_url.serialized_host()));
}
builder.append("</h1>"sv);
builder.append("<!DOCTYPE html>"sv);
builder.append("<html lang=\"en\"><head><meta charset=\"UTF-8\"><title>Error!</title><style>"
":root { color-scheme: light dark; font-family: system-ui, sans-serif; }"
"body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; margin: 0; padding: 1rem; text-align: center; }"
"header { display: flex; flex-direction: column; align-items: center; gap: 2rem; margin-bottom: 1rem; }"
"svg { height: 64px; width: auto; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }"
"h1 { margin: 0; font-size: 1.5rem; }"
"p { font-size: 1rem; color: #555; }"
"</style></head><body>"sv);
builder.append("<header>"sv);
builder.append("<svg id=\"a\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 17.5 21.5\">"sv);
builder.append("<path class=\"b\" d=\"M11.75.75h-9c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-13l-5-5z\"/>"sv);
builder.append("<path class=\"b\" d=\"M10.75.75v4c0 1.1.9 2 2 2h4M4.75 9.75l2 2M10.75 9.75l2 2M12.75 9.75l-2 2M6.75 9.75l-2 2M5.75 16.75c1-2.67 5-2.67 6 0\"/></svg>"sv);
auto escaped_url = escape_html_entities(m_url.to_byte_string());
builder.appendff("The web page <a href=\"{}\">{}</a> has crashed.<br><br>You can reload the page to try again.", escaped_url, escaped_url);
builder.append("</body></html>"sv);