After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702436 - Allow to customize HTTP errors in kiosk mode
Allow to customize HTTP errors in kiosk mode
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks: 702432
 
 
Reported: 2013-06-17 10:04 UTC by Manuel Rego Casasnovas
Modified: 2013-07-05 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add custom http errors support (6.23 KB, patch)
2013-07-03 19:37 UTC, Javier Muñoz
needs-work Details | Review
New patch fixing style issues (6.13 KB, patch)
2013-07-05 08:47 UTC, Javier Muñoz
committed Details | Review

Description Manuel Rego Casasnovas 2013-06-17 10:04:03 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).
Comment 1 Manuel Rego Casasnovas 2013-07-03 12:36:11 UTC
(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.
Comment 2 Javier Muñoz 2013-07-03 19:36:44 UTC
(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.
Comment 3 Javier Muñoz 2013-07-03 19:37:44 UTC
Created attachment 248347 [details] [review]
Add custom http errors support
Comment 4 Manuel Rego Casasnovas 2013-07-05 06:16:12 UTC
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.
Comment 5 Javier Muñoz 2013-07-05 08:47:10 UTC
Created attachment 248444 [details] [review]
New patch fixing style issues
Comment 6 Manuel Rego Casasnovas 2013-07-05 10:51:42 UTC
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.