Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 8bc2af3

Browse files
committed
Merge pull request #468 from adobe/jasonsanjose/OnLoadError
Hide OnLoadError message from end users
2 parents 502b0aa + fde879b commit 8bc2af3

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

appshell/client_handler.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,23 @@ void ClientHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
165165

166166
// Display a load error message.
167167
std::stringstream ss;
168-
ss << "<html><body><h2>Failed to load URL " << std::string(failedUrl) <<
169-
" with error " << std::string(errorText) << " (" << errorCode <<
170-
").</h2></body></html>";
168+
169+
ss << "<html>" <<
170+
"<head>" <<
171+
" <style type='text/css'>" <<
172+
" body { background: #3c3f41; width:100%; height:100%; margin: 0; padding: 0; }" <<
173+
" .logo { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMdJREFUeNpi0Vz9SICBgWE9EDswkAYOAHEgE5maGaB61rPANGdr8QMxH1E6p177BMQfwYawwARBmv38/FAUbtq0CUxjE4cawMDEQCFgwSYIs5mQS8AG/P//nyybYfpYGP6T6fb/1HLB/39kGgDVx/L37z+yDIDpY/n35y+GJCy08YU+TB/L719/yXIBTB/L75+/wIyeky8x4h9XugCpheljFOw4vf8/eZmJgRGYI1l+/vgdCPTPemC0kGQIIyPjASYW5kCAAAMA5Oph7ZyIYMQAAAAASUVORK5CYII='); }"
174+
" .debug { cursor: hand; position: absolute; bottom: 16px; right: 16px; width: 16px; height: 16px; font-family: sans-serif; font-size: .75em; color: #999; }" <<
175+
" </style>" <<
176+
" <script type='text/javascript'>" <<
177+
" var url = '" << std::string(failedUrl) << "';" <<
178+
" var errorText = '" << std::string(errorText) << "';" <<
179+
" var errorCode = '" << errorCode << "';" <<
180+
" var msg = 'Failed to load URL ' + url + ' with error: ' + errorText + ' (' + errorCode + ')';" <<
181+
" console.error(msg);" <<
182+
" </script>" <<
183+
"</head>" <<
184+
"<body><a class='debug logo' onclick='brackets.app.showDeveloperTools()' title='Click to view loading error in Developer Tools'>&nbsp;</a></body></html>";
171185
frame->LoadString(ss.str(), failedUrl);
172186
}
173187

0 commit comments

Comments
 (0)