[webkit-gtk] Allow to open modal
Adrien Schwartzentruber
adrien.schwartzentruber at gmail.com
Thu Sep 11 00:03:52 PDT 2014
Hello guys,
I'm using Webkit2Gtk and i'm facing a difficult that I can't open a
javascript popup.
This is my WebkitView initialization code :
WebKitWebContext* context = webkit_web_context_get_default();
WebKitSettings* settings =
webkit_web_view_get_settings(WEBKIT_WEB_VIEW(self->content_web));
g_object_set(settings, "javascript-can-open-windows-automatically", TRUE,
"allow-modal-dialogs", TRUE, NULL);
webkit_settings_set_sans_serif_font_family(settings, "Helvetica Neue");
webkit_settings_set_enable_javascript(settings, TRUE);
webkit_settings_set_javascript_can_open_windows_automatically(settings,
TRUE);
webkit_settings_set_allow_modal_dialogs(settings, TRUE);
webkit_web_context_set_cache_model(context,
WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER);
webkit_web_context_clear_cache (context);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(self->content_web), "
http://localhost/index.php?logout=true");
webkit_settings_set_enable_page_cache(settings, FALSE);
webkit_web_view_set_settings(WEBKIT_WEB_VIEW(self->content_web), settings);
g_signal_connect(self->content_web, "decide-policy",
G_CALLBACK(decide_policy_cb), self);
g_signal_connect(self->content_web, "create", G_CALLBACK(create), self);
g_signal_connect(self->content_web, "ready-to-show",
G_CALLBACK(read_to_show), self);
g_signal_connect(self->content_web, "run-as-modal",
G_CALLBACK(run_as_modal), self);
The observed behavior is that "create" signal is called but nothing else.
(I return NULL in the callback, and I also tried to create a GtkWindow, if
a WebKitView inside and return the WebKitView).
I probably just miss something obvious, Thx in adavance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20140911/c86581b8/attachment.html>
More information about the webkit-gtk
mailing list