[webkit-gtk] How to get the URI of an about to open window ?

Mesny Jonathan mesny.jo at gmail.com
Mon Jun 21 02:00:51 PDT 2010


Hi,
	I try to get the URI of a newly created web view. The goal of this is to authorize or not the opening of windows or popups (window.open()) in function of their domain.
	For doing this, I connect signals "create-web-view" and "web-view-ready" :

> gboolean webviewReady_handler(WebKitWebView *newWebview, gpointer user_data)
> {
>     g_print("\n\n #NEW WINDOW# referer: %s, URI: %s\n", webkit_web_view_get_uri(WEBKIT_WEB_VIEW(user_data)), webkit_web_view_get_uri(newWebview));
> 
>     return true;
> }
> 
> WebKitWebView* createWebView_handler(WebKitWebView *currentWebView, WebKitWebFrame *frame, gpointer user_data)
> {
>     GtkWidget * newWebview = webkit_web_view_new();
>     g_signal_connect(newWebview, "web-view-ready", G_CALLBACK(webviewReady_handler), currentWebView);
> 
>     return WEBKIT_WEB_VIEW (newWebview);
> }


	But, what I get is something like that :

>  #NEW WINDOW# referer: http://foo.bar, URI: (null)


	Could someone help me please ?
Regards,

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

Jonathan MESNY.
Élève-Ingénieur en 4ème année d'informatique à l'INSA de Lyon

Téléphone portable :  06 77 27 99 55
@personnelle :        mesny.jo at gmail.com
@étudiante :          jonathan.mesny at insa-lyon.fr
@web :                http://jonathanmesny.fr

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20100621/c1205c64/attachment.html>


More information about the webkit-gtk mailing list