Skip to content

Commit b082196

Browse files
committed
Merge branch '4.1'
2 parents 732007d + 215cc60 commit b082196

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

main.c

+9-14
Original file line numberDiff line numberDiff line change
@@ -3999,23 +3999,18 @@ static gboolean policycb(
39993999
webkit_policy_decision_download(dec);
40004000
return true;
40014001
}
4002-
static GtkWidget *createcb(Win *win)
4002+
static GtkWidget *createcb(WebKitWebView* k,
4003+
WebKitNavigationAction* na, Win *win)
40034004
{
40044005
char *handle = getset(win, "newwinhandle");
40054006

40064007
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");
40194014
else if (!g_strcmp0(handle, "back" )) return newwin(NULL, win, win, 1)->kitw;
40204015
else /*normal*/ return newwin(NULL, win, win, 0)->kitw;
40214016

@@ -4679,7 +4674,7 @@ Win *newwin(const char *uri, Win *cbwin, Win *caller, int back)
46794674
SIG( o, "scroll-event" , scrollcb , win);
46804675

46814676
SIG( o, "decide-policy" , policycb , win);
4682-
SIGW(o, "create" , createcb , win);
4677+
SIG( o, "create" , createcb , win);
46834678
SIGW(o, "close" , gtk_widget_destroy, win->winw);
46844679
SIGW(o, "script-dialog" , sdialogcb , win);
46854680
SIG( o, "load-changed" , loadcb , win);

0 commit comments

Comments
 (0)