[Commits] [SCM] claws branch, gtk3, updated. 3.99.0-17-g959585854

miras at claws-mail.org miras at claws-mail.org
Sun Dec 27 20:01:03 CET 2020


The branch, gtk3 has been updated
       via  959585854644ebb831e74e1dd8afa969a05984a9 (commit)
      from  f43e00645076c89adabd853d99a1321503f6ff49 (commit)

Summary of changes:
 src/plugins/fancy/fancy_viewer.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 959585854644ebb831e74e1dd8afa969a05984a9
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sun Dec 27 19:59:31 2020 +0100

    Fix bug #4425: Open link in external browser. Original patch by Orivej Desh. Added fix for crash on right-click on links
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
index 44c0c885e..04797fb98 100644
--- a/src/plugins/fancy/fancy_viewer.c
+++ b/src/plugins/fancy/fancy_viewer.c
@@ -409,6 +409,12 @@ navigation_policy_cb (WebKitWebView    *web_view,
 		      WebKitPolicyDecisionType policy_decision_type,
 		      FancyViewer		*viewer)
 {
+	if (policy_decision_type != WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION)
+		return false;
+
+	WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION(policy_decision);
+	WebKitNavigationAction *navigation_action = webkit_navigation_policy_decision_get_navigation_action(navigation_decision);
+	viewer->cur_link = webkit_uri_request_get_uri(webkit_navigation_action_get_request(navigation_action));
 
 	debug_print("navigation requested to %s\n", viewer->cur_link);
 
@@ -420,11 +426,15 @@ navigation_policy_cb (WebKitWebView    *web_view,
         } else if (!strncmp(viewer->cur_link, "file://", 7) || !strcmp(viewer->cur_link, "about:blank")) {
             debug_print("local navigation request ACCEPTED\n");
             webkit_policy_decision_use(policy_decision);
+        } else if (viewer->override_prefs_external) {
+            debug_print("remote navigation request OPENED\n");
+            open_uri(viewer->cur_link, prefs_common_get_uri_cmd());
+            webkit_policy_decision_ignore(policy_decision);
         } else if (viewer->override_prefs_remote_content) {
             debug_print("remote navigation request ACCEPTED\n");
             webkit_policy_decision_use(policy_decision);
         } else {
-            debug_print("remote avigation request IGNORED\n");
+            debug_print("remote navigation request IGNORED\n");
             fancy_show_notice(viewer, _("Remote content loading is disabled."));
             webkit_policy_decision_ignore(policy_decision);
         }
@@ -867,7 +877,6 @@ static gboolean context_menu_cb (WebKitWebView *view, WebKitContextMenu *menu,
 	if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK &&
 			link_uri != NULL) {
 		if (viewer != NULL && viewer->cur_link != NULL) {
-			g_free(viewer->cur_link);
             /* g_object_get() already made a copy, no need to strdup() here */
             viewer->cur_link = (gchar*)link_uri;
         }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list