@@ -3999,23 +3999,18 @@ static gboolean policycb(
3999
3999
webkit_policy_decision_download (dec );
4000
4000
return true;
4001
4001
}
4002
- static GtkWidget * createcb (Win * win )
4002
+ static GtkWidget * createcb (WebKitWebView * k ,
4003
+ WebKitNavigationAction * na , Win * win )
4003
4004
{
4004
4005
char * handle = getset (win , "newwinhandle" );
4005
4006
4006
4007
if (!g_strcmp0 (handle , "notnew" ))
4007
- if (win -> link && !g_str_has_prefix (win -> link , "javascript:" ))
4008
- {
4009
- showmsg (win , "Create window is canceled" );
4010
- openuri (win , win -> link );
4011
- }
4012
- else
4013
- {
4014
- Win * new = newwin (NULL , win , win , 0 );
4015
- showmsg (new , "Link URL was not set" );
4016
- return new -> kitw ;
4017
- }
4018
- else if (!g_strcmp0 (handle , "ignore" )) showmsg (win , "Create window is ignored" ) ;
4008
+ {
4009
+ openuri (win , webkit_uri_request_get_uri (
4010
+ webkit_navigation_action_get_request (na )));
4011
+ showmsg (win , "Create window is canceled" );
4012
+ }
4013
+ else if (!g_strcmp0 (handle , "ignore" )) showmsg (win , "Create window is ignored" );
4019
4014
else if (!g_strcmp0 (handle , "back" )) return newwin (NULL , win , win , 1 )-> kitw ;
4020
4015
else /*normal*/ return newwin (NULL , win , win , 0 )-> kitw ;
4021
4016
@@ -4679,7 +4674,7 @@ Win *newwin(const char *uri, Win *cbwin, Win *caller, int back)
4679
4674
SIG ( o , "scroll-event" , scrollcb , win );
4680
4675
4681
4676
SIG ( o , "decide-policy" , policycb , win );
4682
- SIGW ( o , "create" , createcb , win );
4677
+ SIG ( o , "create" , createcb , win );
4683
4678
SIGW (o , "close" , gtk_widget_destroy , win -> winw );
4684
4679
SIGW (o , "script-dialog" , sdialogcb , win );
4685
4680
SIG ( o , "load-changed" , loadcb , win );
0 commit comments