GNOME Bugzilla – Bug 592667
add custom error pages to Epiphany
Last modified: 2010-12-10 16:55:45 UTC
webkit allows us to have beautiful errors, let's do. I'm CC'ing Vinicius who prepared some nice stuff during GCDS. Vinicius please upload your work here.
*** Bug 408999 has been marked as a duplicate of this bug. ***
Created attachment 142186 [details] Proposed Error Page for Epiphany
Created attachment 142188 [details] Page Error preview
Created attachment 142196 [details] [review] [PATCH] ephy-session: use a nicer crash recovery page Bug 592667 - add custom error pages to Epiphany This is a test drive to Vinicius work on a nicer template for error pages. We need templates for all the other errors and also plug them in the correct place (ephy-web-view? ephy-window?). Comments welcome. --- configure.ac | 1 + data/Makefile.am | 2 +- data/pages/Makefile.am | 5 ++++ data/pages/recovery.html | 52 ++++++++++++++++++++++++++++++++++++++++ src/ephy-session.c | 59 ++++------------------------------------------ 5 files changed, 64 insertions(+), 55 deletions(-)
This error page uses the default system background, text color and fonts. For the emblem-unreadable icon, we need to make sure it will come from the default theme (by now the template is using the absolute path "file:///usr/share/icons/gnome/32x32/emblems/emblem-unreadable.png"). Thank you :).
*** Bug 436870 has been marked as a duplicate of this bug. ***
Confirmed regression.
I sorted out the hardcoding of the icon path, but due to security in webkit we can't have it load local resources. Apparently setting the referrer would fix it... but I'm not sure if that's a safe thing to do without risking users. Ideas?
I was just wondering (well, consider first I'm not a programmer)... maybe we could attach a GTK+ widget (in this case the GtkImage) to the error page using the create-plugin-widget signal. This would make easier the access to the icon from the current theme.
(In reply to comment #9) > I was just wondering (well, consider first I'm not a programmer)... maybe we > could attach a GTK+ widget (in this case the GtkImage) to the error page using > the create-plugin-widget signal. This would make easier the access to the icon > from the current theme. Sounds like an awesome idea to me!
Created attachment 151684 [details] [review] ephy-session: use a nicer crash recovery page This is a test drive to Vinicius work on a nicer template for error pages. We need templates for all the other errors and also plug them in the correct place (ephy-web-view? ephy-window?). Bug #592667 -- This is an updated patch applying Vinicius idea of using create-plugin-widget. There seems to be a bug in the signal that makes the returned plugin widget not be shown until there's a resize in the WebKitWebView. If you apply the patch and get to the recovery page, you'll see that there's no icon next to "Oops!...", but if you resize the window the icon will appear.
Review of attachment 151684 [details] [review]: Is this working now, or it's still bugging with the scrollbars? ::: src/ephy-session.c @@ +1276,3 @@ +static GtkWidget* +cpw_cb (WebKitWebView *web_view, I don't like the cryptic name. Can it be named create_plugin_widget_cb? @@ +1282,3 @@ + gpointer user_data) +{ + g_debug ("mime: %s", mime_type); remove the g_debug, or make it a LOG @@ +1283,3 @@ +{ + g_debug ("mime: %s", mime_type); + if (g_strcmp0 ("application/x-iconito", mime_type) != 0) how about you add epiphany somewhere in this mime type, just in case? @@ +1290,3 @@ + GTK_ICON_SIZE_DIALOG); + gtk_widget_show (widget); + g_debug ("icono: %p", widget); saca esto ;D
Created attachment 152603 [details] [review] Use nice recovery and error pages Show a nice custom error page instead of WebKit's default. Also create one for crash recovery which currently is just an ugly box. Bug #592667
Created attachment 152604 [details] [review] Use html for error pages only as a template Hold the actual strings for the messages in the .c files so it's easier to translate. Bug #592667
The first patch implements nice pages for load error and crash recovery. It should be clean enough code-wise, however it has no i18n. With the second patch I'm trying to fix that, adding i18n by removing actual text from the .html files, converting them to just placeholders. The actual strings are in the .c files so it's simpler to get them translated. However I don't know if it's evil to have those markup'd strings there... opinions?
*** Bug 464837 has been marked as a duplicate of this bug. ***
Created attachment 176153 [details] [review] Updated patch Uploading for a quick pre-review. -- Use nice recovery and error pages Show a nice custom error page instead of WebKit's default. Also create one for crash recovery which currently is just an ugly box. Bug #592667
Created attachment 176167 [details] [review] Last version, only waiting for Vinicius confirmation on GPLv2. ephy-web-view: use custom error pages Show nice error pages instead of WebKitGTK+'s defaults. FIXME: needs license for html files. Bug #592667
License of html files is GPLv2. Thank you.
Created attachment 176187 [details] [review] ephy-web-view: use custom error pages Show nice error pages instead of WebKitGTK+'s defaults. Bug #592667
Done. High five! Attachment 176187 [details] pushed as e435a10 - ephy-web-view: use custom error pages