Interface

WebKit-6.0WebKitWebViewSignalSignatures

interface SignalSignatures {
    authenticate: (arg0: WebKit.AuthenticationRequest) => boolean | void;
    close: () => void;
    "context-menu": (
        arg0: WebKit.ContextMenu,
        arg1: WebKit.HitTestResult,
    ) => boolean | void;
    "context-menu-dismissed": () => void;
    create: (arg0: NavigationAction) => Gtk.Widget;
    "decide-policy": (
        arg0: WebKit.PolicyDecision,
        arg1: WebKit.PolicyDecisionType,
    ) => boolean | void;
    destroy: () => void;
    "direction-changed": (arg0: Gtk.TextDirection) => void;
    "enter-fullscreen": () => boolean | void;
    hide: () => void;
    "insecure-content-detected": (arg0: WebKit.InsecureContentEvent) => void;
    "keynav-failed": (arg0: Gtk.DirectionType) => boolean | void;
    "leave-fullscreen": () => boolean | void;
    "load-changed": (arg0: WebKit.LoadEvent) => void;
    "load-failed": (
        arg0: WebKit.LoadEvent,
        arg1: string,
        arg2: GLib.Error,
    ) => boolean | void;
    "load-failed-with-tls-errors": (
        arg0: string,
        arg1: Gio.TlsCertificate,
        arg2: Gio.TlsCertificateFlags,
    ) => boolean | void;
    map: () => void;
    "mnemonic-activate": (arg0: boolean) => boolean | void;
    "mouse-target-changed": (arg0: WebKit.HitTestResult, arg1: number) => void;
    "move-focus": (arg0: Gtk.DirectionType) => void;
    notify: (arg0: GObject.ParamSpec) => void;
    "notify::accessible-role": (pspec: GObject.ParamSpec) => void;
    "notify::automation-presentation-type": (pspec: GObject.ParamSpec) => void;
    "notify::camera-capture-state": (pspec: GObject.ParamSpec) => void;
    "notify::can-focus": (pspec: GObject.ParamSpec) => void;
    "notify::can-target": (pspec: GObject.ParamSpec) => void;
    "notify::css-classes": (pspec: GObject.ParamSpec) => void;
    "notify::css-name": (pspec: GObject.ParamSpec) => void;
    "notify::cursor": (pspec: GObject.ParamSpec) => void;
    "notify::default-content-security-policy": (
        pspec: GObject.ParamSpec,
    ) => void;
    "notify::display-capture-state": (pspec: GObject.ParamSpec) => void;
    "notify::editable": (pspec: GObject.ParamSpec) => void;
    "notify::estimated-load-progress": (pspec: GObject.ParamSpec) => void;
    "notify::favicon": (pspec: GObject.ParamSpec) => void;
    "notify::focus-on-click": (pspec: GObject.ParamSpec) => void;
    "notify::focusable": (pspec: GObject.ParamSpec) => void;
    "notify::halign": (pspec: GObject.ParamSpec) => void;
    "notify::has-default": (pspec: GObject.ParamSpec) => void;
    "notify::has-focus": (pspec: GObject.ParamSpec) => void;
    "notify::has-tooltip": (pspec: GObject.ParamSpec) => void;
    "notify::height-request": (pspec: GObject.ParamSpec) => void;
    "notify::hexpand": (pspec: GObject.ParamSpec) => void;
    "notify::hexpand-set": (pspec: GObject.ParamSpec) => void;
    "notify::is-controlled-by-automation": (pspec: GObject.ParamSpec) => void;
    "notify::is-immersive-mode-enabled": (pspec: GObject.ParamSpec) => void;
    "notify::is-loading": (pspec: GObject.ParamSpec) => void;
    "notify::is-muted": (pspec: GObject.ParamSpec) => void;
    "notify::is-playing-audio": (pspec: GObject.ParamSpec) => void;
    "notify::is-web-process-responsive": (pspec: GObject.ParamSpec) => void;
    "notify::layout-manager": (pspec: GObject.ParamSpec) => void;
    "notify::limit-events": (pspec: GObject.ParamSpec) => void;
    "notify::margin-bottom": (pspec: GObject.ParamSpec) => void;
    "notify::margin-end": (pspec: GObject.ParamSpec) => void;
    "notify::margin-start": (pspec: GObject.ParamSpec) => void;
    "notify::margin-top": (pspec: GObject.ParamSpec) => void;
    "notify::microphone-capture-state": (pspec: GObject.ParamSpec) => void;
    "notify::name": (pspec: GObject.ParamSpec) => void;
    "notify::network-session": (pspec: GObject.ParamSpec) => void;
    "notify::opacity": (pspec: GObject.ParamSpec) => void;
    "notify::overflow": (pspec: GObject.ParamSpec) => void;
    "notify::page-id": (pspec: GObject.ParamSpec) => void;
    "notify::parent": (pspec: GObject.ParamSpec) => void;
    "notify::receives-default": (pspec: GObject.ParamSpec) => void;
    "notify::related-view": (pspec: GObject.ParamSpec) => void;
    "notify::root": (pspec: GObject.ParamSpec) => void;
    "notify::scale-factor": (pspec: GObject.ParamSpec) => void;
    "notify::sensitive": (pspec: GObject.ParamSpec) => void;
    "notify::settings": (pspec: GObject.ParamSpec) => void;
    "notify::theme-color": (pspec: GObject.ParamSpec) => void;
    "notify::title": (pspec: GObject.ParamSpec) => void;
    "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void;
    "notify::tooltip-text": (pspec: GObject.ParamSpec) => void;
    "notify::uri": (pspec: GObject.ParamSpec) => void;
    "notify::user-content-manager": (pspec: GObject.ParamSpec) => void;
    "notify::valign": (pspec: GObject.ParamSpec) => void;
    "notify::vexpand": (pspec: GObject.ParamSpec) => void;
    "notify::vexpand-set": (pspec: GObject.ParamSpec) => void;
    "notify::visible": (pspec: GObject.ParamSpec) => void;
    "notify::web-context": (pspec: GObject.ParamSpec) => void;
    "notify::web-extension-mode": (pspec: GObject.ParamSpec) => void;
    "notify::website-policies": (pspec: GObject.ParamSpec) => void;
    "notify::width-request": (pspec: GObject.ParamSpec) => void;
    "notify::zoom-level": (pspec: GObject.ParamSpec) => void;
    "permission-request": (arg0: WebKit.PermissionRequest) => boolean | void;
    print: (arg0: WebKit.PrintOperation) => boolean | void;
    "query-permission-state": (arg0: PermissionStateQuery) => boolean | void;
    "query-tooltip": (
        arg0: number,
        arg1: number,
        arg2: boolean,
        arg3: Gtk.Tooltip,
    ) => boolean | void;
    "ready-to-show": () => void;
    realize: () => void;
    "resource-load-started": (
        arg0: WebKit.WebResource,
        arg1: WebKit.URIRequest,
    ) => void;
    "run-as-modal": () => void;
    "run-color-chooser": (arg0: WebKit.ColorChooserRequest) => boolean | void;
    "run-file-chooser": (arg0: WebKit.FileChooserRequest) => boolean | void;
    "script-dialog": (arg0: ScriptDialog) => boolean | void;
    show: () => void;
    "show-notification": (arg0: WebKit.Notification) => boolean | void;
    "show-option-menu": (
        arg0: WebKit.OptionMenu,
        arg1: Gdk.Rectangle,
    ) => boolean | void;
    "state-flags-changed": (arg0: Gtk.StateFlags) => void;
    "submit-form": (arg0: WebKit.FormSubmissionRequest) => void;
    unmap: () => void;
    unrealize: () => void;
    "user-message-received": (arg0: WebKit.UserMessage) => boolean | void;
    "web-process-terminated": (
        arg0: WebKit.WebProcessTerminationReason,
    ) => void;
}

Hierarchy (View Summary)

Index

Properties

authenticate close context-menu context-menu-dismissed create decide-policy enter-fullscreen insecure-content-detected leave-fullscreen load-changed load-failed load-failed-with-tls-errors mouse-target-changed notify::automation-presentation-type notify::camera-capture-state notify::can-focus notify::can-target notify::css-classes notify::css-name notify::cursor notify::default-content-security-policy notify::display-capture-state notify::editable notify::estimated-load-progress notify::favicon notify::focus-on-click notify::focusable notify::halign notify::has-default notify::has-focus notify::has-tooltip notify::height-request notify::hexpand notify::hexpand-set notify::is-controlled-by-automation notify::is-immersive-mode-enabled notify::is-loading notify::is-muted notify::is-playing-audio notify::is-web-process-responsive notify::layout-manager notify::limit-events notify::margin-bottom notify::margin-end notify::margin-start notify::margin-top notify::microphone-capture-state notify::name notify::network-session notify::opacity notify::overflow notify::page-id notify::parent notify::receives-default notify::related-view notify::root notify::scale-factor notify::sensitive notify::settings notify::theme-color notify::title notify::tooltip-markup notify::tooltip-text notify::uri notify::user-content-manager notify::valign notify::vexpand notify::vexpand-set notify::visible notify::web-context notify::web-extension-mode notify::website-policies notify::width-request notify::zoom-level permission-request print query-permission-state ready-to-show resource-load-started run-as-modal run-color-chooser run-file-chooser script-dialog show-notification show-option-menu submit-form user-message-received web-process-terminated

Properties - Inherited from WebKit.WebViewBase.SignalSignatures

Properties

authenticate: (arg0: WebKit.AuthenticationRequest) => boolean | void

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 request argument. To handle this signal asynchronously you should keep a ref of the request and return true. To disable HTTP authentication entirely, connect to this signal and simply return true.

The default signal handler will run a default authentication dialog asynchronously for the user to interact with.

2.2

close: () => void

Emitted when closing a WebKit.WebView is requested. This occurs when a call is made from JavaScript's window.close function or after trying to close the 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.

"context-menu": (
    arg0: WebKit.ContextMenu,
    arg1: WebKit.HitTestResult,
) => boolean | void

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. To customize the proposed menu you can use 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. To prevent the menu from being displayed you can just connect to this signal and return true so that the proposed menu will not be shown. To build your own menu, you can remove all items from the proposed menu with 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 you just want the default menu to be shown always, simply don't connect to this signal because showing the proposed context menu is the default behaviour.

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.

"context-menu-dismissed": () => void

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.

create: (arg0: NavigationAction) => Gtk.Widget

Emitted 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.

"decide-policy": (
    arg0: WebKit.PolicyDecision,
    arg1: WebKit.PolicyDecisionType,
) => boolean | void

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.

"enter-fullscreen": () => boolean | void

Emitted when JavaScript code calls element.webkitRequestFullScreen. If the signal is not handled the WebKit.WebView will proceed to full screen its top level window. This signal can be used by client code to request permission to the user prior doing the full screen transition and eventually prepare the top-level window (e.g. hide some widgets that would otherwise be part of the full screen window).

"insecure-content-detected": (arg0: WebKit.InsecureContentEvent) => void

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.

since 2.46

"leave-fullscreen": () => boolean | void

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.

"load-changed": (arg0: WebKit.LoadEvent) => void

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;
}
}
"load-failed": (
    arg0: WebKit.LoadEvent,
    arg1: string,
    arg2: GLib.Error,
) => boolean | void

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.

"load-failed-with-tls-errors": (
    arg0: string,
    arg1: Gio.TlsCertificate,
    arg2: Gio.TlsCertificateFlags,
) => boolean | void

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.

2.6

"mouse-target-changed": (arg0: WebKit.HitTestResult, arg1: number) => void

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.

"notify::automation-presentation-type": (pspec: GObject.ParamSpec) => void
"notify::camera-capture-state": (pspec: GObject.ParamSpec) => void
"notify::can-focus": (pspec: GObject.ParamSpec) => void
"notify::can-target": (pspec: GObject.ParamSpec) => void
"notify::css-classes": (pspec: GObject.ParamSpec) => void
"notify::css-name": (pspec: GObject.ParamSpec) => void
"notify::cursor": (pspec: GObject.ParamSpec) => void
"notify::default-content-security-policy": (pspec: GObject.ParamSpec) => void
"notify::display-capture-state": (pspec: GObject.ParamSpec) => void
"notify::editable": (pspec: GObject.ParamSpec) => void
"notify::estimated-load-progress": (pspec: GObject.ParamSpec) => void
"notify::favicon": (pspec: GObject.ParamSpec) => void
"notify::focus-on-click": (pspec: GObject.ParamSpec) => void
"notify::focusable": (pspec: GObject.ParamSpec) => void
"notify::halign": (pspec: GObject.ParamSpec) => void
"notify::has-default": (pspec: GObject.ParamSpec) => void
"notify::has-focus": (pspec: GObject.ParamSpec) => void
"notify::has-tooltip": (pspec: GObject.ParamSpec) => void
"notify::height-request": (pspec: GObject.ParamSpec) => void
"notify::hexpand": (pspec: GObject.ParamSpec) => void
"notify::hexpand-set": (pspec: GObject.ParamSpec) => void
"notify::is-controlled-by-automation": (pspec: GObject.ParamSpec) => void
"notify::is-immersive-mode-enabled": (pspec: GObject.ParamSpec) => void
"notify::is-loading": (pspec: GObject.ParamSpec) => void
"notify::is-muted": (pspec: GObject.ParamSpec) => void
"notify::is-playing-audio": (pspec: GObject.ParamSpec) => void
"notify::is-web-process-responsive": (pspec: GObject.ParamSpec) => void
"notify::layout-manager": (pspec: GObject.ParamSpec) => void
"notify::limit-events": (pspec: GObject.ParamSpec) => void
"notify::margin-bottom": (pspec: GObject.ParamSpec) => void
"notify::margin-end": (pspec: GObject.ParamSpec) => void
"notify::margin-start": (pspec: GObject.ParamSpec) => void
"notify::margin-top": (pspec: GObject.ParamSpec) => void
"notify::microphone-capture-state": (pspec: GObject.ParamSpec) => void
"notify::name": (pspec: GObject.ParamSpec) => void
"notify::network-session": (pspec: GObject.ParamSpec) => void
"notify::opacity": (pspec: GObject.ParamSpec) => void
"notify::overflow": (pspec: GObject.ParamSpec) => void
"notify::page-id": (pspec: GObject.ParamSpec) => void
"notify::parent": (pspec: GObject.ParamSpec) => void
"notify::receives-default": (pspec: GObject.ParamSpec) => void
"notify::related-view": (pspec: GObject.ParamSpec) => void
"notify::root": (pspec: GObject.ParamSpec) => void
"notify::scale-factor": (pspec: GObject.ParamSpec) => void
"notify::sensitive": (pspec: GObject.ParamSpec) => void
"notify::settings": (pspec: GObject.ParamSpec) => void
"notify::theme-color": (pspec: GObject.ParamSpec) => void
"notify::title": (pspec: GObject.ParamSpec) => void
"notify::tooltip-markup": (pspec: GObject.ParamSpec) => void
"notify::tooltip-text": (pspec: GObject.ParamSpec) => void
"notify::uri": (pspec: GObject.ParamSpec) => void
"notify::user-content-manager": (pspec: GObject.ParamSpec) => void
"notify::valign": (pspec: GObject.ParamSpec) => void
"notify::vexpand": (pspec: GObject.ParamSpec) => void
"notify::vexpand-set": (pspec: GObject.ParamSpec) => void
"notify::visible": (pspec: GObject.ParamSpec) => void
"notify::web-context": (pspec: GObject.ParamSpec) => void
"notify::web-extension-mode": (pspec: GObject.ParamSpec) => void
"notify::website-policies": (pspec: GObject.ParamSpec) => void
"notify::width-request": (pspec: GObject.ParamSpec) => void
"notify::zoom-level": (pspec: GObject.ParamSpec) => void
"permission-request": (arg0: WebKit.PermissionRequest) => boolean | void

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.

print: (arg0: WebKit.PrintOperation) => boolean | void

Emitted 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.

"query-permission-state": (arg0: PermissionStateQuery) => boolean | void

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.

2.40

"ready-to-show": () => void

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().

"resource-load-started": (
    arg0: WebKit.WebResource,
    arg1: WebKit.URIRequest,
) => void

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.

"run-as-modal": () => void

Emitted after WebKit.WebView.SignalSignatures.ready_to_show | WebKit.WebView::ready-to-show on the newly created WebKit.WebView when JavaScript code calls window.showModalDialog. The purpose of this signal is to allow the client application to prepare the new view to behave as modal. Once the signal is emitted a new main loop will be run to block user interaction in the parent WebKit.WebView until the new dialog is closed.

"run-color-chooser": (arg0: WebKit.ColorChooserRequest) => boolean | void

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.

2.8

"run-file-chooser": (arg0: WebKit.FileChooserRequest) => boolean | void

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.

"script-dialog": (arg0: ScriptDialog) => boolean | void

Emitted when JavaScript code calls window.alert, window.confirm or window.prompt, or when onbeforeunload event is fired. The 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: WebKit.ScriptDialogType.ALERT: message dialog with a single Close button. WebKit.ScriptDialogType.CONFIRM: message dialog with OK and Cancel buttons. WebKit.ScriptDialogType.PROMPT: message dialog with OK and Cancel buttons and a text entry with the default text. WebKit.ScriptDialogType.BEFORE_UNLOAD_CONFIRM: message dialog with Stay and Leave buttons.

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.

"show-notification": (arg0: WebKit.Notification) => boolean | void

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.

2.8

"show-option-menu": (
    arg0: WebKit.OptionMenu,
    arg1: Gdk.Rectangle,
) => boolean | void

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.

2.18

"submit-form": (arg0: WebKit.FormSubmissionRequest) => void

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.

"user-message-received": (arg0: WebKit.UserMessage) => boolean | void

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.

2.28

"web-process-terminated": (arg0: WebKit.WebProcessTerminationReason) => void

This signal is emitted when the web process terminates abnormally due to reason.

2.20

Properties - Inherited from WebKit.WebViewBase.SignalSignatures

destroy: () => void

Signals 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.

"direction-changed": (arg0: Gtk.TextDirection) => void

Emitted when the text direction of a widget changes.

hide: () => void

Emitted when widget is hidden.

"keynav-failed": (arg0: Gtk.DirectionType) => boolean | void

Emitted if keyboard navigation fails.

See Gtk.Widget.keynav_failed for details.

map: () => void

Emitted 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.

"mnemonic-activate": (arg0: boolean) => boolean | void

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.

"move-focus": (arg0: Gtk.DirectionType) => void

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.

notify: (arg0: GObject.ParamSpec) => void

The 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.

"notify::accessible-role": (pspec: GObject.ParamSpec) => void
"query-tooltip": (
    arg0: number,
    arg1: number,
    arg2: boolean,
    arg3: Gtk.Tooltip,
) => boolean | void

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.

realize: () => void

Emitted 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).

show: () => void

Emitted when widget is shown.

"state-flags-changed": (arg0: Gtk.StateFlags) => void

Emitted when the widget state changes.

See Gtk.Widget.get_state_flags.

unmap: () => void

Emitted 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.

unrealize: () => void

Emitted 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).