diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-09-22 00:42:12 +0800 |
---|---|---|
committer | Carlos Garcia Campos <cgarcia@igalia.com> | 2013-01-11 16:54:05 +0800 |
commit | f256d7fc2dac4f1a3abbcc594be51f62b6f13496 (patch) | |
tree | 9fe4f720f9cff3b1adf72b2b42fbfb9dc7afdf9b /embed/ephy-about-handler.c | |
parent | 148238b49a703b0b3c971a3ae7d430d44a20693a (diff) | |
download | gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.tar gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.tar.gz gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.tar.bz2 gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.tar.lz gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.tar.xz gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.tar.zst gsoc2013-epiphany-f256d7fc2dac4f1a3abbcc594be51f62b6f13496.zip |
Don't use DOM bindings to delete a web application from about:applications
Use a different form for every web application with a hidden value
containing the application id. Then use the policy client to ignore any form
submission from about:applications and delete the application instead,
reloading the about:applications page. This solution will work for
WebKit2 too.
Diffstat (limited to 'embed/ephy-about-handler.c')
-rw-r--r-- | embed/ephy-about-handler.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c index 9f4caf665..e9328a118 100644 --- a/embed/ephy-about-handler.c +++ b/embed/ephy-about-handler.c @@ -210,7 +210,7 @@ ephy_about_handler_handle_applications (GString *data_str) _("Applications"), _("List of installed web applications")); - g_string_append (data_str, "<form><table>"); + g_string_append (data_str, "<table>"); applications = ephy_web_application_get_application_list (); for (p = applications; p; p = p->next) { @@ -220,16 +220,21 @@ ephy_about_handler_handle_applications (GString *data_str) if (g_file_get_contents (app->icon_url, &img_data, &data_length, NULL)) img_data_base64 = g_base64_encode ((guchar*)img_data, data_length); - g_string_append_printf (data_str, "<tbody><tr><td class=\"icon\"><img width=64 height=64 src=\"data:image/png;base64,%s\">" \ - " </img></td><td class=\"data\"><div class=\"appname\">%s</div><div class=\"appurl\">%s</div></td><td class=\"input\"><input type=\"submit\" value=\"Delete\" id=\"%s\"></td><td class=\"date\">%s <br /> %s</td></tr>", - img_data_base64, app->name, app->url, app->name, + g_string_append_printf (data_str, + "<form>" \ + "<tbody><tr>" \ + "<td class=\"icon\"><img width=64 height=64 src=\"data:image/png;base64,%s\"></img></td>" \ + "<td class=\"data\"><div class=\"appname\">%s</div><div class=\"appurl\">%s</div></td>" \ + "<td class=\"input\"><input type=\"hidden\" name=\"app_id\" value=\"%s\"><input type=\"submit\" value=\"Delete\" id=\"%s\">" \ + "</td><td class=\"date\">%s <br /> %s</td></tr></tbody></form>", + img_data_base64, app->name, app->url, app->name, app->name, /* Note for translators: this refers to the installation date. */ _("Installed on:"), app->install_date); g_free (img_data_base64); g_free (img_data); } - g_string_append (data_str, "</form></table></body>"); + g_string_append (data_str, "</table></body>"); ephy_web_application_free_application_list (applications); } |