GNOME Bugzilla – Bug 702436
Allow to customize HTTP errors in kiosk mode
Last modified: 2013-07-05 10:52:01 UTC
In a kiosk browser if a server returns a 404 error the user could get stuck in the error page (as he has no menus to come back to the previous one). For this situations we need a customizable management of HTTP client (4xx) and server (5xx) errors. The initial behavior would be to redirect the user to the homepage, or load an alternate HTML (that could be local HTML file showing links to go to the homepage or come back).
(In reply to comment #0) > The initial behavior would be to redirect the user to the homepage, or load an > alternate HTML (that could be local HTML file showing links to go to the > homepage or come back). We've been working in this feature and the initial approach will show a Epiphany error page with a proper message about the status code. We'll reuse the current error page for network problems. Maybe it could be interesting to do some changes in Epiphany error pages in order to provide more functionality like reload, go back, go to overview/homepage, etc. In any case this would be done in a later patch.
(In reply to comment #1) > We've been working in this feature and the initial approach will show a > Epiphany error page with a proper message about the status code. Attaching the patch. It adds custom http errors support.
Created attachment 248347 [details] [review] Add custom http errors support
Review of attachment 248347 [details] [review]: LGTM, thanks! Just some minor nits before pushing it. ::: embed/ephy-web-view.c @@ +2181,3 @@ + guint status_code; + + web_resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW(view)); Style: missing space between "WEBKIT_WEB_VIEW" and "(". @@ +2186,3 @@ + + if (SOUP_STATUS_IS_CLIENT_ERROR(status_code) || + Style: Again missing space before "(" in both SOUP_STATUS_IS_CLIENT_ERROR and SOUP_STATUS_IS_SERVER_ERROR. @@ +2187,3 @@ + if (SOUP_STATUS_IS_CLIENT_ERROR(status_code) || + SOUP_STATUS_IS_SERVER_ERROR(status_code)) + web_resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW(view)); Style: This "{" should be in the if line. @@ +2189,3 @@ + { + GError *error; + response = webkit_web_resource_get_response (web_resource); Optional: You can directly declare and init the variable in the same line. @@ +2198,3 @@ + error); + g_error_free (error); + SOUP_STATUS_IS_SERVER_ERROR(status_code)) Style: This "}" doesn't appear properly justified. @@ +2479,3 @@ + msg_title = g_strdup (_("Oops! A HTTP error status code has been detected")); + msg = g_strdup_printf (_("<p>The website at <strong>%s</strong> has returned " + "the following HTTP error status code:</p>" Style: Review justification for this line. @@ +2480,3 @@ + msg = g_strdup_printf (_("<p>The website at <strong>%s</strong> has returned " + "the following HTTP error status code:</p>" + "<p><em>%s</em></p>"), Style: Justify with 1-space more.
Created attachment 248444 [details] [review] New patch fixing style issues
Review of attachment 248444 [details] [review]: Thanks. I've removed some tabs introduced in your patch as ephy-web-view.c was only using spaces. The patch has been pushed into "kiosk-mode" branch. ::: embed/ephy-web-view.c @@ +2478,3 @@ + msg = g_strdup_printf (_("<p>The website at <strong>%s</strong> has returned " + "the following HTTP error status code:</p>" + "<p><em>%s</em></p>"), I've did a minor change before pushing the patch and used just 1 paragraph to show the status code.