WebView
The central class of the WPE WebKit and WebKitGTK APIs.
#WebKitWebView is the central class of the WPE WebKit and WebKitGTK APIs. It is responsible for managing the drawing of the content and forwarding of events. You can load any URI into the #WebKitWebView or a data string. With #WebKitSettings you can control various aspects of the rendering and loading of the content.
Note that in WebKitGTK, #WebKitWebView is scrollable by itself, so you don't need to embed it in a #GtkScrolledWindow.
Skipped during bindings generation
parameter
certificate
: certificate: Out parameter is not supportedmethod
editable
: Property has no gettermethod
is-controlled-by-automation
: Property has no getter nor settermethod
is-loading
: Property has no getter nor settermethod
is-playing-audio
: Property has no getter nor settermethod
related-view
: Property has no getter nor settermethod
settings
: Property has no gettermethod
web-context
: Property has no getter nor setter
Constructors
Properties
The #WebKitAutomationBrowsingContextPresentation of #WebKitWebView. This should only be used when creating a new #WebKitWebView as a response to #WebKitAutomationSession::create-web-view signal request. If the new WebView was added to a new tab of current browsing context window %WEBKIT_AUTOMATION_BROWSING_CONTEXT_PRESENTATION_TAB should be used.
Capture state of the camera device. Whenever the user grants a media-request sent by the web page, requesting video capture capabilities (navigator.mediaDevices.getUserMedia({video: true})
) this property will be set to %WEBKIT_MEDIA_CAPTURE_STATE_ACTIVE.
The default Content-Security-Policy used by the webview as if it were set by an HTTP header.
Capture state of the display device. Whenever the user grants a media-request sent by the web page, requesting screencasting capabilities (`navigator.mediaDevices.getDisplayMedia() this property will be set to %WEBKIT_MEDIA_CAPTURE_STATE_ACTIVE.
An estimate of the percent completion for the current loading operation. This value will range from 0.0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0.0. The value is an estimate based on the total number of bytes expected to be received for a document, including all its possible subresources and child documents.
Whether the web process currently associated to the #WebKitWebView is responsive.
Capture state of the microphone device. Whenever the user grants a media-request sent by the web page, requesting audio capture capabilities (navigator.mediaDevices.getUserMedia({audio: true})
) this property will be set to %WEBKIT_MEDIA_CAPTURE_STATE_ACTIVE.
The #WebKitNetworkSession of the view
The #WebKitUserContentManager of the view.
This configures @web_view to treat the content as a WebExtension.
The #WebKitWebsitePolicies for the view.
Functions
Asynchronously call @body with @arguments in the script world with name @world_name of the main frame current context in @web_view. The @arguments values must be one of the following types, or contain only the following GVariant types: number, string and dictionary. The result of the operation can be a Promise that will be properly passed to the callback. If @world_name is null, the default world is used. Any value that is not null is a distin ct world. The @source_uri will be shown in exceptions and doesn't affect the behavior of the script. When not provided, the document URL is used.
Finish an asynchronous operation started with webkit_web_view_call_async_javascript_function().
Asynchronously check if it is possible to execute the given editing command.
Finish an asynchronous operation started with webkit_web_view_can_execute_editing_command().
Determines whether @web_view has a next history item.
Whether or not a MIME type can be displayed in @web_view.
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 #WebKitAuthenticationRequest 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.
Emitted when closing a #WebKitWebView is requested. This occurs when a call is made from JavaScript's
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.
Emitted after #WebKitWebView::context-menu signal, if the context menu is shown, to notify that the context menu is dismissed.
Emitted when the creation of a new #WebKitWebView is requested. If this signal is handled the signal handler should return the newly created #WebKitWebView.
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 #WebKitNavigationPolicyDecision passed in the
Emitted when JavaScript code calls
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.
Emitted when the #WebKitWebView 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 #WebKitWebView::enter-fullscreen stage for instance.
Emitted when a load operation in @web_view changes. The signal is always emitted with %WEBKIT_LOAD_STARTED when a new load request is made and %WEBKIT_LOAD_FINISHED when the load finishes successfully or due to an error. When the ongoing load operation fails #WebKitWebView::load-failed signal is emitted before #WebKitWebView::load-changed is emitted with %WEBKIT_LOAD_FINISHED. If a redirection is received from the server, this signal is emitted with %WEBKIT_LOAD_REDIRECTED after the initial emission with %WEBKIT_LOAD_STARTED and before %WEBKIT_LOAD_COMMITTED. When the page content starts arriving the signal is emitted with %WEBKIT_LOAD_COMMITTED event.
Emitted when an error occurs during a load operation. If the error happened when starting to load data for a page
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().
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
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.
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.
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().
Emitted after #WebKitWebView::create on the newly created #WebKitWebView 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 #WebKitWindowProperties of @web_view. See also webkit_web_view_get_window_properties().
Emitted when a new resource is going to be loaded. The @request parameter contains the #WebKitURIRequest that will be sent to the server. You can monitor the load operation by connecting to the different signals of @resource.
Emitted after #WebKitWebView::ready-to-show on the newly created #WebKitWebView when JavaScript code calls
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 #WebKitColorChooserRequest in the @request argument.
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 #WebKitFileChooserRequest in the @request argument.
Emitted when JavaScript code calls
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.
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 #WebKitWebView 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.
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.
This signal is emitted when a #WebKitUserMessage is received from the #WebKitWebPage corresponding to @web_view. You can reply to the message using webkit_user_message_send_reply().
This signal is emitted when the web process terminates abnormally due to @reason.
Requests downloading of the specified URI string for @web_view.
Asynchronously evaluate @script in the script world with name @world_name of the main frame current context in @web_view. If @world_name is null, the default world is used. Any value that is not null is a distinct world. The @source_uri will be shown in exceptions and doesn't affect the behavior of the script. When not provided, the document URL is used.
Finish an asynchronous operation started with webkit_web_view_evaluate_javascript().
Request to execute the given @command for @web_view.
Request to execute the given @command with @argument for @web_view.
Obtains the #WebKitBackForwardList associated with the given #WebKitWebView.
Gets the color that is used to draw the @web_view background.
Gets the web context of @web_view.
Returns the current custom character encoding name of @web_view.
Gets the web editor state of @web_view.
Gets the #WebKitFindController.
Get the #WebKitInputMethodContext currently in use by @web_view.
Get the #WebKitWebInspector associated to @web_view
Return the main resource of @web_view.
Gets the current session state of @web_view
Asynchronously retrieves a snapshot of @web_view for @region.
Finishes an asynchronous operation started with webkit_web_view_get_snapshot().
Gets the #WebKitSettings currently applied to @web_view.
Get the #WebKitWindowProperties object.
Loads the specific history item @list_item.
Get whether a #WebKitWebView was created with #WebKitWebView:is-controlled-by-automation property enabled.
Gets whether the user is allowed to edit the HTML document.
Gets the value of the #WebKitWebView:is-playing-audio property.
Load the given @content string for the URI @content_uri.
Load the specified @plain_text string into @web_view.
Requests loading of the specified #WebKitURIRequest.
Reloads the current contents of @web_view without using any cached data.
Restore the @web_view session state from @state
Finish an asynchronous operation started with webkit_web_view_save().
Asynchronously save the current web page.
Finish an asynchronous operation started with webkit_web_view_save_to_file().
Send @message to the #WebKitWebPage corresponding to @web_view.
Finish an asynchronous operation started with webkit_web_view_send_message_to_page().
Sets the color that will be used to draw the @web_view background.
Sets the @allowlist for CORS.
Sets the current custom character encoding override of @web_view.
Sets whether the user is allowed to edit the HTML document.
Set the #WebKitInputMethodContext to be used by @web_view.
Sets the #WebKitSettings to be applied to @web_view.
Stops any ongoing loading operation in @web_view.
Terminates the web process associated to @web_view.