[evolution/gnome-3-22] Bug 776415 - Cancel request, rather than redirect to about:blank, in composer
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-22] Bug 776415 - Cancel request, rather than redirect to about:blank, in composer
- Date: Mon, 9 Jan 2017 17:04:58 +0000 (UTC)
commit 7ae0f6fd18b87508c04c1f07f4257681e5f983c5
Author: Milan Crha <mcrha redhat com>
Date: Mon Jan 9 18:04:12 2017 +0100
Bug 776415 - Cancel request, rather than redirect to about:blank, in composer
.../web-extension/e-editor-web-extension.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension.c
b/modules/webkit-editor/web-extension/e-editor-web-extension.c
index cc37069..c41c154 100644
--- a/modules/webkit-editor/web-extension/e-editor-web-extension.c
+++ b/modules/webkit-editor/web-extension/e-editor-web-extension.c
@@ -2368,7 +2368,7 @@ image_exists_in_cache (const gchar *image_uri)
return exists;
}
-static void
+static gboolean
redirect_http_uri (EEditorWebExtension *extension,
WebKitWebPage *web_page,
WebKitURIRequest *request)
@@ -2381,7 +2381,7 @@ redirect_http_uri (EEditorWebExtension *extension,
EImageLoadingPolicy image_policy;
editor_page = get_editor_page (extension, webkit_web_page_get_id (web_page));
- g_return_if_fail (E_IS_EDITOR_PAGE (editor_page));
+ g_return_val_if_fail (E_IS_EDITOR_PAGE (editor_page), FALSE);
uri = webkit_uri_request_get_uri (request);
@@ -2394,8 +2394,7 @@ redirect_http_uri (EEditorWebExtension *extension,
image_policy = e_editor_page_get_image_loading_policy (editor_page);
if (!image_exists && !e_editor_page_get_force_image_load (editor_page) &&
(image_policy == E_IMAGE_LOADING_POLICY_NEVER)) {
- webkit_uri_request_set_uri (request, "about:blank");
- return;
+ return FALSE;
}
new_uri = g_strconcat ("evo-", uri, NULL);
@@ -2407,6 +2406,8 @@ redirect_http_uri (EEditorWebExtension *extension,
soup_uri_free (soup_uri);
g_free (new_uri);
+
+ return TRUE;
}
static gboolean
@@ -2432,8 +2433,9 @@ web_page_send_request_cb (WebKitWebPage *web_page,
g_str_has_prefix (request_uri, "evo-http:") ||
g_str_has_prefix (request_uri, "evo-https:");
- if (uri_is_http)
- redirect_http_uri (extension, web_page, request);
+ if (uri_is_http &&
+ !redirect_http_uri (extension, web_page, request))
+ return TRUE;
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]