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
parent 40760308c6
commit fd80d3d48b
2 changed files with 18 additions and 13 deletions

View file

@ -22,7 +22,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
gap: 2rem;
margin-bottom: 1rem;
}
svg {
@ -30,7 +30,7 @@
width: auto;
stroke: currentColor;
fill: none;
stroke-width: 2;
stroke-width: 1.5;
stroke-linecap: round;
stroke-linejoin: round;
}
@ -46,9 +46,9 @@
</head>
<body>
<header>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 22">
<path d="M12 1H3a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6z"/>
<path d="M11 1v4a2 2 0 0 0 2 2h4M6 10v2m6-2v2M6 17c1-2.67 5-2.67 6 0"/>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17.5 21.5">
<path 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"/>
<path d="M10.75.75v4c0 1.1.9 2 2 2h4M5.75 9.75v2M11.75 9.75v2M5.75 16.75c1-2.67 5-2.67 6 0"/>
</svg>
<h1>Failed to load %failed_url%</h1>
</header>

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);