SignalRun LastauthenticateSignalRun LastcloseEmitted when closing a WebKit.WebView is requested. This occurs when a
call is made from JavaScript's web_view with webkit_web_view_try_close().
It is the owner's responsibility to handle this signal to hide or
destroy the WebKit.WebView, if necessary.
SignalRun Lastcontext-Emitted when a context menu is about to be displayed to give the application
a chance to customize the proposed menu, prevent the menu from being displayed,
or build its own context menu.
webkit_context_menu_prepend(),
webkit_context_menu_append() or webkit_context_menu_insert() to add new
WebKit.ContextMenuItems to context_menu, webkit_context_menu_move_item()
to reorder existing items, or webkit_context_menu_remove() to remove an
existing item. The signal handler should return false, and the menu represented
by context_menu will be shown.
true so that the proposed menu will not be shown.
webkit_context_menu_remove_all(), add your own items and return false so
that the menu will be shown. You can also ignore the proposed WebKit.ContextMenu,
build your own GtkMenu and return true to prevent the proposed menu from being shown.
If the signal handler returns false the context menu represented by context_menu
will be shown, if it return true the context menu will not be shown.
The proposed WebKit.ContextMenu passed in context_menu argument is only valid
during the signal emission.
SignalRun Lastcontext-Emitted after WebKit.WebView.SignalSignatures.context_menu | WebKit.WebView::context-menu signal, if the context menu is shown, to notify that the context menu is dismissed.
SignalRun LastcreateEmitted when the creation of a new WebKit.WebView is requested. If this signal is handled the signal handler should return the newly created WebKit.WebView.
The WebKit.NavigationAction parameter contains information about the navigation action that triggered this signal.
The new WebKit.WebView must be related to web_view, see
WebKit.WebView.related_view for more details.
The new WebKit.WebView should not be displayed to the user until the WebKit.WebView.SignalSignatures.ready_to_show | WebKit.WebView::ready-to-show signal is emitted.
For creating views as response to automation tools requests, see the WebKit.AutomationSession.SignalSignatures.create_web_view | WebKit.AutomationSession::create-web-view signal.
SignalRun Lastdecide-This signal is emitted when WebKit is requesting the client to decide a policy
decision, such as whether to navigate to a page, open a new window or whether or
not to download a resource. The WebKit.NavigationPolicyDecision passed in the
decision argument is a generic type, but should be casted to a more
specific type when making the decision. For example:
static gboolean
decide_policy_cb (WebKitWebView *web_view,
WebKitPolicyDecision *decision,
WebKitPolicyDecisionType type)
{
switch (type) {
case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: {
WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
// Make a policy decision here
break;
}
case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: {
WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
// Make a policy decision here
break;
}
case WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision);
// Make a policy decision here
break;
default:
// Making no decision results in `webkit_policy_decision_use()`
return FALSE;
}
return TRUE;
}
It is possible to make policy decision asynchronously, by simply calling g_object_ref()
on the decision argument and returning true to block the default signal handler.
If the last reference is removed on a WebKit.PolicyDecision and no decision has been
made explicitly, webkit_policy_decision_use() will be the default policy decision. The
default signal handler will simply call webkit_policy_decision_use(). Only the first
policy decision chosen for a given WebKit.PolicyDecision will have any affect.
SignalRun Lastenter-Emitted when JavaScript code calls
SignalRun LastDeprecatedinsecure-Prior to 2.46, this signal was emitted when insecure content was loaded in a secure content. Since 2.46, this signal is generally no longer emitted.
SignalRun Lastleave-Emitted when the WebKit.WebView is about to restore its top level window out of its full screen state. This signal can be used by client code to restore widgets hidden during the WebKit.WebView.SignalSignatures.enter_fullscreen | WebKit.WebView::enter-fullscreen stage for instance.
SignalRun Lastload-Emitted when a load operation in web_view changes.
The signal is always emitted with WebKit.LoadEvent.STARTED when a
new load request is made and WebKit.LoadEvent.FINISHED when the load
finishes successfully or due to an error. When the ongoing load
operation fails WebKit.WebView.SignalSignatures.load_failed | WebKit.WebView::load-failed signal is emitted
before WebKit.WebView.SignalSignatures.load_changed | WebKit.WebView::load-changed is emitted with
WebKit.LoadEvent.FINISHED.
If a redirection is received from the server, this signal is emitted
with WebKit.LoadEvent.REDIRECTED after the initial emission with
WebKit.LoadEvent.STARTED and before WebKit.LoadEvent.COMMITTED.
When the page content starts arriving the signal is emitted with
WebKit.LoadEvent.COMMITTED event.
You can handle this signal and use a switch to track any ongoing load operation.
static void web_view_load_changed (WebKitWebView *web_view,
WebKitLoadEvent load_event,
gpointer user_data)
{
switch (load_event) {
case WEBKIT_LOAD_STARTED:
// New load, we have now a provisional URI
provisional_uri = webkit_web_view_get_uri (web_view);
// Here we could start a spinner or update the
// location bar with the provisional URI
break;
case WEBKIT_LOAD_REDIRECTED:
redirected_uri = webkit_web_view_get_uri (web_view);
break;
case WEBKIT_LOAD_COMMITTED:
// The load is being performed. Current URI is
// the final one and it won't change unless a new
// load is requested or a navigation within the
// same page is performed
uri = webkit_web_view_get_uri (web_view);
break;
case WEBKIT_LOAD_FINISHED:
// Load finished, we can now stop the spinner
break;
}
}
SignalRun Lastload-Emitted when an error occurs during a load operation.
If the error happened when starting to load data for a page
load_event will be WebKit.LoadEvent.STARTED. If it happened while
loading a committed data source load_event will be WebKit.LoadEvent.COMMITTED.
Since a load error causes the load operation to finish, the signal
WebKitWebView::load-changed will always be emitted with
WebKit.LoadEvent.FINISHED event right after this one.
By default, if the signal is not handled, a stock error page will be displayed. You need to handle the signal if you want to provide your own error page.
SignalRun Lastload-Emitted when a TLS error occurs during a load operation.
To allow an exception for this certificate
and the host of failing_uri use webkit_web_context_allow_tls_certificate_for_host().
To handle this signal asynchronously you should call g_object_ref() on certificate
and return true.
If false is returned, WebKit.WebView.SignalSignatures.load_failed | WebKit.WebView::load-failed will be emitted. The load
will finish regardless of the returned value.
SignalRun Lastmouse-This signal is emitted when the mouse cursor moves over an
element such as a link, image or a media element. To determine
what type of element the mouse cursor is over, a Hit Test is performed
on the current mouse coordinates and the result is passed in the
hit_test_result argument. The modifiers argument is a bitmask of
Gdk.ModifierType flags indicating the state of modifier keys.
The signal is emitted again when the mouse is moved out of the
current element with a new hit_test_result.
SignalRun Lastpermission-This signal is emitted when WebKit is requesting the client to decide about a permission request, such as allowing the browser to switch to fullscreen mode, sharing its location or similar operations.
A possible way to use this signal could be through a dialog allowing the user decide what to do with the request:
static gboolean permission_request_cb (WebKitWebView *web_view,
WebKitPermissionRequest *request,
GtkWindow *parent_window)
{
GtkWidget *dialog = gtk_message_dialog_new (parent_window,
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
"Allow Permission Request?");
gtk_widget_show (dialog);
gint result = gtk_dialog_run (GTK_DIALOG (dialog));
switch (result) {
case GTK_RESPONSE_YES:
webkit_permission_request_allow (request);
break;
default:
webkit_permission_request_deny (request);
break;
}
gtk_widget_destroy (dialog);
return TRUE;
}
It is possible to handle permission requests asynchronously, by
simply calling g_object_ref() on the request argument and
returning true to block the default signal handler. If the
last reference is removed on a WebKit.PermissionRequest and the
request has not been handled, webkit_permission_request_deny()
will be the default action.
If the signal is not handled, the request will be completed automatically
by the specific WebKit.PermissionRequest that could allow or deny it. Check the
documentation of classes implementing WebKit.PermissionRequest interface to know
their default action.
SignalRun LastprintEmitted when printing is requested on web_view, usually by a JavaScript call,
before the print dialog is shown. This signal can be used to set the initial
print settings and page setup of print_operation to be used as default values in
the print dialog. You can call webkit_print_operation_set_print_settings() and
webkit_print_operation_set_page_setup() and then return false to propagate the
event so that the print dialog is shown.
You can connect to this signal and return true to cancel the print operation
or implement your own print dialog.
SignalRun Lastquery-This signal allows the User-Agent to respond to permission requests for powerful features, as
specified by the Permissions W3C Specification.
You can reply to the query using webkit_permission_state_query_finish().
You can handle the query asynchronously by calling webkit_permission_state_query_ref() on
query and returning true. If the last reference of query is removed and the query has not
been handled, the query result will be set to WEBKIT_QUERY_PERMISSION_PROMPT.
SignalRun Lastready-Emitted after WebKit.WebView::create on the newly created WebKit.WebView
when it should be displayed to the user. When this signal is emitted
all the information about how the window should look, including
size, position, whether the location, status and scrollbars
should be displayed, is already set on the WebKit.WindowProperties
of web_view. See also webkit_web_view_get_window_properties().
SignalRun Lastresource-Emitted when a new resource is going to be loaded. The request parameter
contains the WebKit.URIRequest that will be sent to the server.
You can monitor the load operation by connecting to the different signals
of resource.
SignalRun Lastrun-Emitted after WebKit.WebView.SignalSignatures.ready_to_show | WebKit.WebView::ready-to-show on the newly
created WebKit.WebView when JavaScript code calls
SignalRun Lastrun-This signal is emitted when the user interacts with a HTML element, requesting from WebKit to show
a dialog to select a color. To let the application know the details of
the color chooser, as well as to allow the client application to either
cancel the request or perform an actual color selection, the signal will
pass an instance of the WebKit.ColorChooserRequest in the request
argument.
It is possible to handle this request asynchronously by increasing the reference count of the request.
The default signal handler will asynchronously run a regular Gtk.ColorChooser for the user to interact with.
SignalRun Lastrun-This signal is emitted when the user interacts with a HTML element, requesting from WebKit to show
a dialog to select one or more files to be uploaded. To let the
application know the details of the file chooser, as well as to
allow the client application to either cancel the request or
perform an actual selection of files, the signal will pass an
instance of the WebKit.FileChooserRequest in the request
argument.
The default signal handler will asynchronously run a regular Gtk.FileChooserDialog for the user to interact with.
SignalRun Lastscript-Emitted when JavaScript code calls dialog parameter should be used to build the dialog.
If the signal is not handled a different dialog will be built and shown depending
on the dialog type:
It is possible to handle the script dialog request asynchronously, by simply
caling webkit_script_dialog_ref() on the dialog argument and calling
webkit_script_dialog_close() when done.
If the last reference is removed on a WebKit.ScriptDialog and the dialog has not been
closed, webkit_script_dialog_close() will be called.
SignalRun Lastshow-This signal is emitted when a notification should be presented to the
user. The notification is kept alive until either: 1) the web page cancels it
or 2) a navigation happens.
The default handler will emit a notification using libnotify, if built with support for it.
SignalRun Lastshow-This signal is emitted when a select element in web_view needs to display a
dropdown menu. This signal can be used to show a custom menu, using menu to get
the details of all items that should be displayed. The area of the element in the
WebKit.WebView is given as rectangle parameter, it can be used to position the
menu.
To handle this signal asynchronously you should keep a ref of the menu.
The default signal handler will pop up a GtkMenu.
SignalRun Lastsubmit-This signal is emitted when a form is about to be submitted. The request
argument passed contains information about the text fields of the form. This
is typically used to store login information that can be used later to
pre-fill the form.
The form will not be submitted until webkit_form_submission_request_submit() is called.
It is possible to handle the form submission request asynchronously, by
simply calling g_object_ref() on the request argument and calling
webkit_form_submission_request_submit() when done to continue with the form submission.
If the last reference is removed on a WebKit.FormSubmissionRequest and the
form has not been submitted, webkit_form_submission_request_submit() will be called.
SignalRun Lastuser-This signal is emitted when a WebKit.UserMessage is received from the
WebKitWebPage corresponding to web_view. You can reply to the message
using webkit_user_message_send_reply().
You can handle the user message asynchronously by calling g_object_ref() on
message and returning true. If the last reference of message is removed
and the message has not been replied to, the operation in the WebKitWebPage will
finish with error WebKit.UserMessageError.MESSAGE.
SignalRun Lastweb-This signal is emitted when the web process terminates abnormally due
to reason.
SignalRun CleanupdestroySignals that all holders of a reference to the widget should release the reference that they hold.
May result in finalization of the widget if all references are released.
This signal is not suitable for saving widget state.
SignalRun Firstdirection-Emitted when the text direction of a widget changes.
SignalRun FirsthideEmitted when widget is hidden.
SignalRun Lastkeynav-Emitted if keyboard navigation fails.
See Gtk.Widget.keynav_failed for details.
SignalRun FirstmapEmitted when widget is going to be mapped.
A widget is mapped when the widget is visible (which is controlled with Gtk.Widget.visible) and all its parents up to the toplevel widget are also visible.
The ::map signal can be used to determine whether a widget will be drawn,
for instance it can resume an animation that was stopped during the
emission of Gtk.Widget::unmap.
SignalRun Lastmnemonic-Emitted when a widget is activated via a mnemonic.
The default handler for this signal activates widget if group_cycling
is false, or just makes widget grab focus if group_cycling is true.
SignalActionRun Lastmove-Emitted when the focus is moved.
The ::move-focus signal is a keybinding signal.
The default bindings for this signal are Tab to move forward, and Shift+Tab to move backward.
SignalDetailedActionRun FirstnotifyThe notify signal is emitted on an object when one of its properties has
its value set through g_object_set_property(), g_object_set(), et al.
Note that getting this signal doesn’t itself guarantee that the value of
the property has actually changed. When it is emitted is determined by the
derived GObject class. If the implementor did not create the property with
GObject.ParamFlags.EXPLICIT_NOTIFY, then any call to g_object_set_property() results
in ::notify being emitted, even if the new value is the same as the old.
If they did pass GObject.ParamFlags.EXPLICIT_NOTIFY, then this signal is emitted only
when they explicitly call g_object_notify() or g_object_notify_by_pspec(),
and common practice is to do that only when the value has actually changed.
This signal is typically used to obtain change notification for a
single property, by specifying the property name as a detail in the
g_signal_connect() call, like this:
g_signal_connect (text_view->buffer, "notify::paste-target-list",
G_CALLBACK (gtk_text_view_target_list_notify),
text_view)
It is important to note that you must use [canonical parameter names][class@GObject.ParamSpec#parameter-names] as detail strings for the notify signal.
SignalRun Lastquery-Emitted when the widget’s tooltip is about to be shown.
This happens when the Gtk.Widget.has_tooltip property
is true and the hover timeout has expired with the cursor hovering
above widget; or emitted when widget got focus in keyboard mode.
Using the given coordinates, the signal handler should determine
whether a tooltip should be shown for widget. If this is the case
true should be returned, false otherwise. Note that if keyboard_mode
is true, the values of x and y are undefined and should not be used.
The signal handler is free to manipulate tooltip with the therefore
destined function calls.
SignalRun FirstrealizeEmitted when widget is associated with a Gdk.Surface.
This means that Gtk.Widget.realize has been called or the widget has been mapped (that is, it is going to be drawn).
SignalRun FirstshowEmitted when widget is shown.
SignalRun Firststate-Emitted when the widget state changes.
SignalRun FirstunmapEmitted when widget is going to be unmapped.
A widget is unmapped when either it or any of its parents up to the toplevel widget have been set as hidden.
As ::unmap indicates that a widget will not be shown any longer,
it can be used to, for example, stop an animation on the widget.
SignalRun LastunrealizeEmitted when the Gdk.Surface associated with widget is destroyed.
This means that Gtk.Widget.unrealize has been called or the widget has been unmapped (that is, it is going to be hidden).
This signal is emitted when the user is challenged with HTTP authentication. To let the application access or supply the credentials as well as to allow the client application to either cancel the request or perform the authentication, the signal will pass an instance of the WebKit.AuthenticationRequest in the
requestargument. To handle this signal asynchronously you should keep a ref of the request and returntrue. To disable HTTP authentication entirely, connect to this signal and simply returntrue.The default signal handler will run a default authentication dialog asynchronously for the user to interact with.