changeset 32587:a17de1f525a9

Handle better webkit's navigation-policy-decision-requested signal to be able to manage external files, links and theme files.
author masca@cpw.pidgin.im
date Tue, 23 Aug 2011 06:21:27 +0000
parents 8e7dcf8cce44
children 472e70ea58ed
files pidgin/gtkwebview.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkwebview.c	Tue Aug 23 06:18:42 2011 +0000
+++ b/pidgin/gtkwebview.c	Tue Aug 23 06:21:27 2011 +0000
@@ -184,12 +184,19 @@
 		      WebKitWebPolicyDecision *policy_decision)
 {
 	const gchar *uri;
+	WebKitWebNavigationReason reason;
 
 	uri = webkit_network_request_get_uri (request);
+	reason = webkit_web_navigation_action_get_reason(navigation_action);
 
-	/* the gtk imhtml way was to create an idle cb, not sure
-	 * why, so right now just using purple_notify_uri directly */
-	purple_notify_uri (NULL, uri);
+	if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) {
+		/* the gtk imhtml way was to create an idle cb, not sure
+		 * why, so right now just using purple_notify_uri directly */
+		purple_notify_uri (NULL, uri);
+	}
+
+	webkit_web_policy_decision_use(policy_decision);
+
 	return TRUE;
 }