Updating branch refs/heads/master to 7c7be5644d0b8a64c5e6d433b3bcefc9a05466e8 (commit) from 6fd666aa9fac694df1019fab36ef97b222a55f46 (commit)
commit 7c7be5644d0b8a64c5e6d433b3bcefc9a05466e8 Author: Christian Dywan <christ...@twotoasts.de> Date: Sun Feb 26 00:01:55 2012 +0100 Honor site data policy when requesting HTML5 databases See: https://bugs.launchpad.net/midori/+bug/767442 midori/midori-view.c | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 3ac9001..ebddca1 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1288,15 +1288,32 @@ midori_view_web_view_database_quota_exceeded_cb (WebKitWebView* web_view, MidoriView* view) { const gchar* uri = webkit_web_frame_get_uri (web_frame); - gchar* hostname = midori_uri_parse_hostname (uri, NULL); - gchar* message = g_strdup_printf (_("%s wants to save an HTML5 database."), - hostname && *hostname ? hostname : uri); - midori_view_add_info_bar (view, GTK_MESSAGE_QUESTION, message, - G_CALLBACK (midori_view_database_response_cb), database, - _("_Deny"), GTK_RESPONSE_REJECT, _("_Allow"), GTK_RESPONSE_ACCEPT, - NULL); - g_free (hostname); - g_free (message); + MidoriSiteDataPolicy policy = midori_web_settings_get_site_data_policy (view->settings, uri); + + switch (policy) + { + case MIDORI_SITE_DATA_BLOCK: + { + WebKitSecurityOrigin* origin = webkit_web_database_get_security_origin (database); + webkit_security_origin_set_web_database_quota (origin, 0); + webkit_web_database_remove (database); + } + case MIDORI_SITE_DATA_ACCEPT: + case MIDORI_SITE_DATA_PRESERVE: + return; + case MIDORI_SITE_DATA_UNDETERMINED: + { + gchar* hostname = midori_uri_parse_hostname (uri, NULL); + gchar* message = g_strdup_printf (_("%s wants to save an HTML5 database."), + hostname && *hostname ? hostname : uri); + midori_view_add_info_bar (view, GTK_MESSAGE_QUESTION, message, + G_CALLBACK (midori_view_database_response_cb), database, + _("_Deny"), GTK_RESPONSE_REJECT, _("_Allow"), GTK_RESPONSE_ACCEPT, + NULL); + g_free (hostname); + g_free (message); + } + } } #if WEBKIT_CHECK_VERSION (1, 1, 23) _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits