WebKitWebView

WebKitWebView — The central class of the WPE WebKit and WebKitGTK APIs

Functions

GtkWidget * webkit_web_view_new ()
GtkWidget * webkit_web_view_new_with_context ()
GtkWidget * webkit_web_view_new_with_related_view ()
GtkWidget * webkit_web_view_new_with_settings ()
GtkWidget * webkit_web_view_new_with_user_content_manager ()
gboolean webkit_web_view_is_ephemeral ()
gboolean webkit_web_view_is_controlled_by_automation ()
WebKitAutomationBrowsingContextPresentation webkit_web_view_get_automation_presentation_type ()
WebKitWebContext * webkit_web_view_get_context ()
WebKitUserContentManager * webkit_web_view_get_user_content_manager ()
WebKitWebsiteDataManager * webkit_web_view_get_website_data_manager ()
void webkit_web_view_try_close ()
void webkit_web_view_load_uri ()
void webkit_web_view_load_html ()
void webkit_web_view_load_alternate_html ()
void webkit_web_view_load_plain_text ()
void webkit_web_view_load_bytes ()
void webkit_web_view_load_request ()
gboolean webkit_web_view_can_go_back ()
void webkit_web_view_go_back ()
gboolean webkit_web_view_can_go_forward ()
void webkit_web_view_go_forward ()
const gchar * webkit_web_view_get_title ()
guint64 webkit_web_view_get_page_id ()
void webkit_web_view_reload ()
void webkit_web_view_reload_bypass_cache ()
void webkit_web_view_stop_loading ()
gboolean webkit_web_view_is_loading ()
gboolean webkit_web_view_is_playing_audio ()
void webkit_web_view_set_is_muted ()
gboolean webkit_web_view_get_is_muted ()
gdouble webkit_web_view_get_estimated_load_progress ()
const gchar * webkit_web_view_get_custom_charset ()
void webkit_web_view_set_custom_charset ()
WebKitBackForwardList * webkit_web_view_get_back_forward_list ()
void webkit_web_view_go_to_back_forward_list_item ()
const gchar * webkit_web_view_get_uri ()
cairo_surface_t * webkit_web_view_get_favicon ()
void webkit_web_view_set_settings ()
WebKitSettings * webkit_web_view_get_settings ()
WebKitWindowProperties * webkit_web_view_get_window_properties ()
void webkit_web_view_set_zoom_level ()
gdouble webkit_web_view_get_zoom_level ()
void webkit_web_view_can_execute_editing_command ()
gboolean webkit_web_view_can_execute_editing_command_finish ()
void webkit_web_view_execute_editing_command ()
void webkit_web_view_execute_editing_command_with_argument ()
WebKitFindController * webkit_web_view_get_find_controller ()
WebKitWebInspector * webkit_web_view_get_inspector ()
JSGlobalContextRef webkit_web_view_get_javascript_global_context ()
void webkit_web_view_run_javascript ()
WebKitJavascriptResult * webkit_web_view_run_javascript_finish ()
void webkit_web_view_run_javascript_in_world ()
WebKitJavascriptResult * webkit_web_view_run_javascript_in_world_finish ()
void webkit_web_view_run_javascript_from_gresource ()
WebKitJavascriptResult * webkit_web_view_run_javascript_from_gresource_finish ()
gboolean webkit_web_view_can_show_mime_type ()
void webkit_web_view_save ()
GInputStream * webkit_web_view_save_finish ()
void webkit_web_view_save_to_file ()
gboolean webkit_web_view_save_to_file_finish ()
WebKitDownload * webkit_web_view_download_uri ()
gboolean webkit_web_view_get_tls_info ()
void webkit_web_view_get_snapshot ()
cairo_surface_t * webkit_web_view_get_snapshot_finish ()
void webkit_web_view_set_background_color ()
void webkit_web_view_get_background_color ()
void webkit_web_view_set_editable ()
gboolean webkit_web_view_is_editable ()
WebKitEditorState * webkit_web_view_get_editor_state ()
WebKitWebViewSessionState * webkit_web_view_get_session_state ()
void webkit_web_view_restore_session_state ()
WebKitWebResource * webkit_web_view_get_main_resource ()
void webkit_web_view_send_message_to_page ()
WebKitUserMessage * webkit_web_view_send_message_to_page_finish ()
void webkit_web_view_set_input_method_context ()
WebKitInputMethodContext * webkit_web_view_get_input_method_context ()
WebKitWebsitePolicies * webkit_web_view_get_website_policies ()
gboolean webkit_web_view_get_is_web_process_responsive ()
void webkit_web_view_terminate_web_process ()
void webkit_web_view_set_cors_allowlist ()
WebKitMediaCaptureState webkit_web_view_get_camera_capture_state ()
WebKitMediaCaptureState webkit_web_view_get_microphone_capture_state ()
void webkit_web_view_set_camera_capture_state ()
void webkit_web_view_set_microphone_capture_state ()
WebKitMediaCaptureState webkit_web_view_get_display_capture_state ()
void webkit_web_view_set_display_capture_state ()
WebKitJavascriptResult * webkit_javascript_result_ref ()
void webkit_javascript_result_unref ()
JSGlobalContextRef webkit_javascript_result_get_global_context ()
JSValueRef webkit_javascript_result_get_value ()
JSCValue * webkit_javascript_result_get_js_value ()
WebKitScriptDialog * webkit_script_dialog_ref ()
void webkit_script_dialog_unref ()
WebKitScriptDialogType webkit_script_dialog_get_dialog_type ()
const gchar * webkit_script_dialog_get_message ()
void webkit_script_dialog_confirm_set_confirmed ()
const gchar * webkit_script_dialog_prompt_get_default_text ()
void webkit_script_dialog_prompt_set_text ()
void webkit_script_dialog_close ()
WebKitWebViewSessionState * webkit_web_view_session_state_new ()
WebKitWebViewSessionState * webkit_web_view_session_state_ref ()
void webkit_web_view_session_state_unref ()
GBytes * webkit_web_view_session_state_serialize ()

Properties

WebKitAutomationBrowsingContextPresentation automation-presentation-type Read / Write / Construct Only
WebKitMediaCaptureState camera-capture-state Read / Write
WebKitMediaCaptureState display-capture-state Read / Write
gboolean editable Read / Write
gdouble estimated-load-progress Read
gpointer favicon Read
gboolean is-controlled-by-automation Read / Write / Construct Only
gboolean is-ephemeral Read / Write / Construct Only
gboolean is-loading Read
gboolean is-muted Read / Write
gboolean is-playing-audio Read
gboolean is-web-process-responsive Read
WebKitMediaCaptureState microphone-capture-state Read / Write
guint64 page-id Read
WebKitWebView * related-view Write / Construct Only
WebKitSettings * settings Write / Construct
gchar * title Read
gchar * uri Read
WebKitUserContentManager * user-content-manager Read / Write / Construct Only
WebKitWebContext * web-context Read / Write / Construct Only
WebKitWebsitePolicies * website-policies Read / Write / Construct Only
gdouble zoom-level Read / Write

Signals

gboolean authenticate Run Last
void close Run Last
gboolean context-menu Run Last
void context-menu-dismissed Run Last
GtkWidget* create Run Last
gboolean decide-policy Run Last
gboolean enter-fullscreen Run Last
void insecure-content-detected Run Last
gboolean leave-fullscreen Run Last
void load-changed Run Last
gboolean load-failed Run Last
gboolean load-failed-with-tls-errors Run Last
void mouse-target-changed Run Last
gboolean permission-request Run Last
gboolean print Run Last
void ready-to-show Run Last
void resource-load-started Run Last
void run-as-modal Run Last
gboolean run-color-chooser Run Last
gboolean run-file-chooser Run Last
gboolean script-dialog Run Last
gboolean show-notification Run Last
gboolean show-option-menu Run Last
void submit-form Run Last
gboolean user-message-received Run Last
gboolean web-process-crashed Run Last
void web-process-terminated Run Last

Types and Values

Object Hierarchy

    GBoxed
    ├── WebKitJavascriptResult
    ├── WebKitScriptDialog
    ╰── WebKitWebViewSessionState
    GEnum
    ├── WebKitAutoplayPolicy
    ├── WebKitInsecureContentEvent
    ├── WebKitLoadEvent
    ├── WebKitMediaCaptureState
    ├── WebKitPolicyDecisionType
    ╰── WebKitWebProcessTerminationReason
    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── WebKitWebViewBase
                    ╰── WebKitWebView

Implemented Interfaces

WebKitWebView implements AtkImplementorIface and GtkBuildable.

Description

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.

Functions

webkit_web_view_new ()

GtkWidget *
webkit_web_view_new (void);

Creates a new WebKitWebView with the default WebKitWebContext and no WebKitUserContentManager associated with it. See also webkit_web_view_new_with_context(), webkit_web_view_new_with_user_content_manager(), and webkit_web_view_new_with_settings().

Returns

The newly created WebKitWebView widget


webkit_web_view_new_with_context ()

GtkWidget *
webkit_web_view_new_with_context (WebKitWebContext *context);

Creates a new WebKitWebView with the given WebKitWebContext and no WebKitUserContentManager associated with it. See also webkit_web_view_new_with_user_content_manager() and webkit_web_view_new_with_settings().

Parameters

context

the WebKitWebContext to be used by the WebKitWebView

 

Returns

The newly created WebKitWebView widget


webkit_web_view_new_with_related_view ()

GtkWidget *
webkit_web_view_new_with_related_view (WebKitWebView *web_view);

Creates a new WebKitWebView sharing the same web process with web_view . This method doesn't have any effect when WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS process model is used, because a single web process is shared for all the web views in the same WebKitWebContext. When using WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES process model, this method should always be used when creating the WebKitWebView in the “create” signal. You can also use this method to implement other process models based on WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES, like for example, sharing the same web process for all the views in the same security domain.

The newly created WebKitWebView will also have the same WebKitUserContentManager, WebKitSettings, and WebKitWebsitePolicies as web_view .

[constructor]

Parameters

web_view

the related WebKitWebView

 

Returns

The newly created WebKitWebView widget.

[transfer full]

Since: 2.4


webkit_web_view_new_with_settings ()

GtkWidget *
webkit_web_view_new_with_settings (WebKitSettings *settings);

Creates a new WebKitWebView with the given WebKitSettings. See also webkit_web_view_new_with_context(), and webkit_web_view_new_with_user_content_manager().

Parameters

settings

a WebKitSettings

 

Returns

The newly created WebKitWebView widget

Since: 2.6


webkit_web_view_new_with_user_content_manager ()

GtkWidget *
webkit_web_view_new_with_user_content_manager
                               (WebKitUserContentManager *user_content_manager);

Creates a new WebKitWebView with the given WebKitUserContentManager. The content loaded in the view may be affected by the content injected in the view by the user content manager.

Parameters

user_content_manager

a WebKitUserContentManager.

 

Returns

The newly created WebKitWebView widget

Since: 2.6


webkit_web_view_is_ephemeral ()

gboolean
webkit_web_view_is_ephemeral (WebKitWebView *web_view);

Get whether a WebKitWebView is ephemeral. To create an ephemeral WebKitWebView you need to use g_object_new() and pass is-ephemeral property with TRUE value. See “is-ephemeral” for more details. If web_view was created with a ephemeral “related-view” or an ephemeral “web-context” it will also be ephemeral.

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if web_view is ephemeral or FALSE otherwise.

Since: 2.16


webkit_web_view_is_controlled_by_automation ()

gboolean
webkit_web_view_is_controlled_by_automation
                               (WebKitWebView *web_view);

Get whether a WebKitWebView was created with “is-controlled-by-automation” property enabled. Only WebKitWebViews controlled by automation can be used in an automation session.

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if web_view is controlled by automation, or FALSE otherwise.

Since: 2.18


webkit_web_view_get_automation_presentation_type ()

WebKitAutomationBrowsingContextPresentation
webkit_web_view_get_automation_presentation_type
                               (WebKitWebView *web_view);

Get the presentation type of WebKitWebView when created for automation.

Parameters

web_view

a WebKitWebView

 

Since: 2.28


webkit_web_view_get_context ()

WebKitWebContext *
webkit_web_view_get_context (WebKitWebView *web_view);

Gets the web context of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitWebContext of the view.

[transfer none]


webkit_web_view_get_user_content_manager ()

WebKitUserContentManager *
webkit_web_view_get_user_content_manager
                               (WebKitWebView *web_view);

Gets the user content manager associated to web_view .

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitUserContentManager associated with the view.

[transfer none]

Since: 2.6


webkit_web_view_get_website_data_manager ()

WebKitWebsiteDataManager *
webkit_web_view_get_website_data_manager
                               (WebKitWebView *web_view);

Get the WebKitWebsiteDataManager associated to web_view . If web_view is not ephemeral, the returned WebKitWebsiteDataManager will be the same as the WebKitWebsiteDataManager of web_view 's WebKitWebContext.

Parameters

web_view

a WebKitWebView

 

Returns

a WebKitWebsiteDataManager.

[transfer none]

Since: 2.16


webkit_web_view_try_close ()

void
webkit_web_view_try_close (WebKitWebView *web_view);

Tries to close the web_view . This will fire the onbeforeunload event to ask the user for confirmation to close the page. If there isn't an onbeforeunload event handler or the user confirms to close the page, the “close” signal is emitted, otherwise nothing happens.

Parameters

web_view

a WebKitWebView

 

Since: 2.12


webkit_web_view_load_uri ()

void
webkit_web_view_load_uri (WebKitWebView *web_view,
                          const gchar *uri);

Requests loading of the specified URI string. You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

uri

an URI string

 

webkit_web_view_load_html ()

void
webkit_web_view_load_html (WebKitWebView *web_view,
                           const gchar *content,
                           const gchar *base_uri);

Load the given content string with the specified base_uri . If base_uri is not NULL, relative URLs in the content will be resolved against base_uri and absolute local paths must be children of the base_uri . For security reasons absolute local paths that are not children of base_uri will cause the web process to terminate. If you need to include URLs in content that are local paths in a different directory than base_uri you can build a data URI for them. When base_uri is NULL, it defaults to "about:blank". The mime type of the document will be "text/html". You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

content

The HTML string to load

 

base_uri

The base URI for relative locations or NULL.

[allow-none]

webkit_web_view_load_alternate_html ()

void
webkit_web_view_load_alternate_html (WebKitWebView *web_view,
                                     const gchar *content,
                                     const gchar *content_uri,
                                     const gchar *base_uri);

Load the given content string for the URI content_uri . This allows clients to display page-loading errors in the WebKitWebView itself. When this method is called from “load-failed” signal to show an error page, then the back-forward list is maintained appropriately. For everything else this method works the same way as webkit_web_view_load_html().

Parameters

web_view

a WebKitWebView

 

content

the new content to display as the main page of the web_view

 

content_uri

the URI for the alternate page content

 

base_uri

the base URI for relative locations or NULL.

[allow-none]

webkit_web_view_load_plain_text ()

void
webkit_web_view_load_plain_text (WebKitWebView *web_view,
                                 const gchar *plain_text);

Load the specified plain_text string into web_view . The mime type of document will be "text/plain". You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

plain_text

The plain text to load

 

webkit_web_view_load_bytes ()

void
webkit_web_view_load_bytes (WebKitWebView *web_view,
                            GBytes *bytes,
                            const gchar *mime_type,
                            const gchar *encoding,
                            const gchar *base_uri);

Load the specified bytes into web_view using the given mime_type and encoding . When mime_type is NULL, it defaults to "text/html". When encoding is NULL, it defaults to "UTF-8". When base_uri is NULL, it defaults to "about:blank". You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

bytes

input data to load

 

mime_type

the MIME type of bytes , or NULL.

[allow-none]

encoding

the character encoding of bytes , or NULL.

[allow-none]

base_uri

the base URI for relative locations or NULL.

[allow-none]

Since: 2.6


webkit_web_view_load_request ()

void
webkit_web_view_load_request (WebKitWebView *web_view,
                              WebKitURIRequest *request);

Requests loading of the specified WebKitURIRequest. You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

request

a WebKitURIRequest to load

 

webkit_web_view_can_go_back ()

gboolean
webkit_web_view_can_go_back (WebKitWebView *web_view);

Determines whether web_view has a previous history item.

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if able to move back or FALSE otherwise.


webkit_web_view_go_back ()

void
webkit_web_view_go_back (WebKitWebView *web_view);

Loads the previous history item. You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

webkit_web_view_can_go_forward ()

gboolean
webkit_web_view_can_go_forward (WebKitWebView *web_view);

Determines whether web_view has a next history item.

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if able to move forward or FALSE otherwise.


webkit_web_view_go_forward ()

void
webkit_web_view_go_forward (WebKitWebView *web_view);

Loads the next history item. You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

webkit_web_view_get_title ()

const gchar *
webkit_web_view_get_title (WebKitWebView *web_view);

Gets the value of the “title” property. You can connect to notify::title signal of web_view to be notified when the title has been received.

Parameters

web_view

a WebKitWebView

 

Returns

The main frame document title of web_view .


webkit_web_view_get_page_id ()

guint64
webkit_web_view_get_page_id (WebKitWebView *web_view);

Get the identifier of the WebKitWebPage corresponding to the WebKitWebView

Parameters

web_view

a WebKitWebView

 

Returns

the page ID of web_view .


webkit_web_view_reload ()

void
webkit_web_view_reload (WebKitWebView *web_view);

Reloads the current contents of web_view . See also webkit_web_view_reload_bypass_cache().

Parameters

web_view

a WebKitWebView

 

webkit_web_view_reload_bypass_cache ()

void
webkit_web_view_reload_bypass_cache (WebKitWebView *web_view);

Reloads the current contents of web_view without using any cached data.

Parameters

web_view

a WebKitWebView

 

webkit_web_view_stop_loading ()

void
webkit_web_view_stop_loading (WebKitWebView *web_view);

Stops any ongoing loading operation in web_view . This method does nothing if no content is being loaded. If there is a loading operation in progress, it will be cancelled and “load-failed” signal will be emitted with WEBKIT_NETWORK_ERROR_CANCELLED error.

Parameters

web_view

a WebKitWebView

 

webkit_web_view_is_loading ()

gboolean
webkit_web_view_is_loading (WebKitWebView *web_view);

Gets the value of the “is-loading” property. You can monitor when a WebKitWebView is loading a page by connecting to notify::is-loading signal of web_view . This is useful when you are interesting in knowing when the view is loading something but not in the details about the status of the load operation, for example to start a spinner when the view is loading a page and stop it when it finishes.

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if web_view is loading a page or FALSE otherwise.


webkit_web_view_is_playing_audio ()

gboolean
webkit_web_view_is_playing_audio (WebKitWebView *web_view);

Gets the value of the “is-playing-audio” property. You can monitor when a page in a WebKitWebView is playing audio by connecting to the notify::is-playing-audio signal of web_view . This is useful when the application wants to provide visual feedback when a page is producing sound.

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if a page in web_view is playing audio or FALSE otherwise.

Since: 2.8


webkit_web_view_set_is_muted ()

void
webkit_web_view_set_is_muted (WebKitWebView *web_view,
                              gboolean muted);

Sets the mute state of web_view .

Parameters

web_view

a WebKitWebView

 

muted

mute flag

 

Since: 2.30


webkit_web_view_get_is_muted ()

gboolean
webkit_web_view_get_is_muted (WebKitWebView *web_view);

Gets the mute state of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

TRUE if web_view audio is muted or FALSE is audio is not muted.

Since: 2.30


webkit_web_view_get_estimated_load_progress ()

gdouble
webkit_web_view_get_estimated_load_progress
                               (WebKitWebView *web_view);

Gets the value of the “estimated-load-progress” property. You can monitor the estimated progress of a load operation by connecting to the notify::estimated-load-progress signal of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

an estimate of the of the percent complete for a document load as a range from 0.0 to 1.0.


webkit_web_view_get_custom_charset ()

const gchar *
webkit_web_view_get_custom_charset (WebKitWebView *web_view);

Returns the current custom character encoding name of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

the current custom character encoding name or NULL if no custom character encoding has been set.


webkit_web_view_set_custom_charset ()

void
webkit_web_view_set_custom_charset (WebKitWebView *web_view,
                                    const gchar *charset);

Sets the current custom character encoding override of web_view . The custom character encoding will override any text encoding detected via HTTP headers or META tags. Calling this method will stop any current load operation and reload the current page. Setting the custom character encoding to NULL removes the character encoding override.

Parameters

web_view

a WebKitWebView

 

charset

a character encoding name or NULL.

[allow-none]

webkit_web_view_get_back_forward_list ()

WebKitBackForwardList *
webkit_web_view_get_back_forward_list (WebKitWebView *web_view);

Obtains the WebKitBackForwardList associated with the given WebKitWebView. The WebKitBackForwardList is owned by the WebKitWebView.

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitBackForwardList.

[transfer none]


webkit_web_view_go_to_back_forward_list_item ()

void
webkit_web_view_go_to_back_forward_list_item
                               (WebKitWebView *web_view,
                                WebKitBackForwardListItem *list_item);

Loads the specific history item list_item . You can monitor the load operation by connecting to “load-changed” signal.

Parameters

web_view

a WebKitWebView

 

list_item

a WebKitBackForwardListItem

 

webkit_web_view_get_uri ()

const gchar *
webkit_web_view_get_uri (WebKitWebView *web_view);

Returns the current active URI of web_view . The active URI might change during a load operation:

  1. When nothing has been loaded yet on web_view the active URI is NULL.

  2. When a new load operation starts the active URI is the requested URI:

  3. If there is a server redirection during the load operation, the active URI is the redirected URI. When the signal “load-changed” is emitted with WEBKIT_LOAD_REDIRECTED event, the active URI is already updated to the redirected URI.

  4. When the signal “load-changed” is emitted with WEBKIT_LOAD_COMMITTED event, the active URI is the final one and it will not change unless a new load operation is started or a navigation action within the same page is performed.

You can monitor the active URI by connecting to the notify::uri signal of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

the current active URI of web_view or NULL if nothing has been loaded yet.


webkit_web_view_get_favicon ()

cairo_surface_t *
webkit_web_view_get_favicon (WebKitWebView *web_view);

Returns favicon currently associated to web_view , if any. You can connect to notify::favicon signal of web_view to be notified when the favicon is available.

Parameters

web_view

a WebKitWebView

 

Returns

a pointer to a cairo_surface_t with the favicon or NULL if there's no icon associated with web_view .

[transfer none]


webkit_web_view_set_settings ()

void
webkit_web_view_set_settings (WebKitWebView *web_view,
                              WebKitSettings *settings);

Sets the WebKitSettings to be applied to web_view . The existing WebKitSettings of web_view will be replaced by settings . New settings are applied immediately on web_view . The same WebKitSettings object can be shared by multiple WebKitWebViews.

Parameters

web_view

a WebKitWebView

 

settings

a WebKitSettings

 

webkit_web_view_get_settings ()

WebKitSettings *
webkit_web_view_get_settings (WebKitWebView *web_view);

Gets the WebKitSettings currently applied to web_view . If no other WebKitSettings have been explicitly applied to web_view with webkit_web_view_set_settings(), the default WebKitSettings will be returned. This method always returns a valid WebKitSettings object. To modify any of the web_view settings, you can either create a new WebKitSettings object with webkit_settings_new(), setting the desired preferences, and then replace the existing web_view settings with webkit_web_view_set_settings() or get the existing web_view settings and update it directly. WebKitSettings objects can be shared by multiple WebKitWebViews, so modifying the settings of a WebKitWebView would affect other WebKitWebViews using the same WebKitSettings.

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitSettings attached to web_view .

[transfer none]


webkit_web_view_get_window_properties ()

WebKitWindowProperties *
webkit_web_view_get_window_properties (WebKitWebView *web_view);

Get the WebKitWindowProperties object containing the properties that the window containing web_view should have.

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitWindowProperties of web_view .

[transfer none]


webkit_web_view_set_zoom_level ()

void
webkit_web_view_set_zoom_level (WebKitWebView *web_view,
                                gdouble zoom_level);

Set the zoom level of web_view , i.e. the factor by which the view contents are scaled with respect to their original size.

Parameters

web_view

a WebKitWebView

 

zoom_level

the zoom level

 

webkit_web_view_get_zoom_level ()

gdouble
webkit_web_view_get_zoom_level (WebKitWebView *web_view);

Get the zoom level of web_view , i.e. the factor by which the view contents are scaled with respect to their original size.

Parameters

web_view

a WebKitWebView

 

Returns

the current zoom level of web_view


webkit_web_view_can_execute_editing_command ()

void
webkit_web_view_can_execute_editing_command
                               (WebKitWebView *web_view,
                                const gchar *command,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously check if it is possible to execute the given editing command.

When the operation is finished, callback will be called. You can then call webkit_web_view_can_execute_editing_command_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

command

the command to check

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

webkit_web_view_can_execute_editing_command_finish ()

gboolean
webkit_web_view_can_execute_editing_command_finish
                               (WebKitWebView *web_view,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_web_view_can_execute_editing_command().

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

TRUE if the editing command can be executed or FALSE otherwise


webkit_web_view_execute_editing_command ()

void
webkit_web_view_execute_editing_command
                               (WebKitWebView *web_view,
                                const gchar *command);

Request to execute the given command for web_view . You can use webkit_web_view_can_execute_editing_command() to check whether it's possible to execute the command.

Parameters

web_view

a WebKitWebView

 

command

the command to execute

 

webkit_web_view_execute_editing_command_with_argument ()

void
webkit_web_view_execute_editing_command_with_argument
                               (WebKitWebView *web_view,
                                const char *command,
                                const char *argument);

Request to execute the given command with argument for web_view . You can use webkit_web_view_can_execute_editing_command() to check whether it's possible to execute the command.

Parameters

web_view

a WebKitWebView

 

command

the command to execute

 

argument

the command argument

 

Since: 2.10


webkit_web_view_get_find_controller ()

WebKitFindController *
webkit_web_view_get_find_controller (WebKitWebView *web_view);

Gets the WebKitFindController that will allow the caller to query the WebKitWebView for the text to look for.

Parameters

web_view

the WebKitWebView

 

Returns

the WebKitFindController associated to this particular WebKitWebView.

[transfer none]


webkit_web_view_get_inspector ()

WebKitWebInspector *
webkit_web_view_get_inspector (WebKitWebView *web_view);

Get the WebKitWebInspector associated to web_view

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitWebInspector of web_view .

[transfer none]


webkit_web_view_get_javascript_global_context ()

JSGlobalContextRef
webkit_web_view_get_javascript_global_context
                               (WebKitWebView *web_view);

webkit_web_view_get_javascript_global_context has been deprecated since version 2.22 and should not be used in newly-written code.

Use jsc_value_get_context() instead.

Get the global JavaScript context used by web_view to deserialize the result values of scripts executed with webkit_web_view_run_javascript().

[skip]

Parameters

web_view

a WebKitWebView

 

Returns

the JSGlobalContextRef used by web_view to deserialize the result values of scripts.


webkit_web_view_run_javascript ()

void
webkit_web_view_run_javascript (WebKitWebView *web_view,
                                const gchar *script,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously run script in the context of the current page in web_view . If WebKitSettings:enable-javascript is FALSE, this method will do nothing.

When the operation is finished, callback will be called. You can then call webkit_web_view_run_javascript_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

script

the script to run

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the script finished.

[scope async]

user_data

the data to pass to callback function.

[closure]

webkit_web_view_run_javascript_finish ()

WebKitJavascriptResult *
webkit_web_view_run_javascript_finish (WebKitWebView *web_view,
                                       GAsyncResult *result,
                                       GError **error);

Finish an asynchronous operation started with webkit_web_view_run_javascript().

This is an example of using webkit_web_view_run_javascript() with a script returning a string:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
static void
web_view_javascript_finished (GObject      *object,
                              GAsyncResult *result,
                              gpointer      user_data)
{
    WebKitJavascriptResult *js_result;
    JSCValue               *value;
    GError                 *error = NULL;

    js_result = webkit_web_view_run_javascript_finish (WEBKIT_WEB_VIEW (object), result, &error);
    if (!js_result) {
        g_warning ("Error running javascript: %s", error->message);
        g_error_free (error);
        return;
    }

    value = webkit_javascript_result_get_js_value (js_result);
    if (jsc_value_is_string (value)) {
        JSCException *exception;
        gchar        *str_value;

        str_value = jsc_value_to_string (value);
        exception = jsc_context_get_exception (jsc_value_get_context (value));
        if (exception)
            g_warning ("Error running javascript: %s", jsc_exception_get_message (exception));
        else
            g_print ("Script result: %s\n", str_value);
        g_free (str_value);
    } else {
        g_warning ("Error running javascript: unexpected return value");
    }
    webkit_javascript_result_unref (js_result);
}

static void
web_view_get_link_url (WebKitWebView *web_view,
                       const gchar   *link_id)
{
    gchar *script;

    script = g_strdup_printf ("window.document.getElementById('%s').href;", link_id);
    webkit_web_view_run_javascript (web_view, script, NULL, web_view_javascript_finished, NULL);
    g_free (script);
}

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a WebKitJavascriptResult with the result of the last executed statement in script or NULL in case of error.

[transfer full]


webkit_web_view_run_javascript_in_world ()

void
webkit_web_view_run_javascript_in_world
                               (WebKitWebView *web_view,
                                const gchar *script,
                                const gchar *world_name,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously run script in the script world with name world_name of the current page context in web_view . If WebKitSettings:enable-javascript is FALSE, this method will do nothing.

When the operation is finished, callback will be called. You can then call webkit_web_view_run_javascript_in_world_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

script

the script to run

 

world_name

the name of a WebKitScriptWorld

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the script finished.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.22


webkit_web_view_run_javascript_in_world_finish ()

WebKitJavascriptResult *
webkit_web_view_run_javascript_in_world_finish
                               (WebKitWebView *web_view,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_web_view_run_javascript_in_world().

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a WebKitJavascriptResult with the result of the last executed statement in script or NULL in case of error.

[transfer full]

Since: 2.22


webkit_web_view_run_javascript_from_gresource ()

void
webkit_web_view_run_javascript_from_gresource
                               (WebKitWebView *web_view,
                                const gchar *resource,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously run the script from resource in the context of the current page in web_view .

When the operation is finished, callback will be called. You can then call webkit_web_view_run_javascript_from_gresource_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

resource

the location of the resource to load

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the script finished.

[scope async]

user_data

the data to pass to callback function.

[closure]

webkit_web_view_run_javascript_from_gresource_finish ()

WebKitJavascriptResult *
webkit_web_view_run_javascript_from_gresource_finish
                               (WebKitWebView *web_view,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_web_view_run_javascript_from_gresource().

Check webkit_web_view_run_javascript_finish() for a usage example.

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a WebKitJavascriptResult with the result of the last executed statement in script or NULL in case of error.

[transfer full]


webkit_web_view_can_show_mime_type ()

gboolean
webkit_web_view_can_show_mime_type (WebKitWebView *web_view,
                                    const gchar *mime_type);

Whether or not a MIME type can be displayed in web_view .

Parameters

web_view

a WebKitWebView

 

mime_type

a MIME type

 

Returns

TRUE if the MIME type mime_type can be displayed or FALSE otherwise


webkit_web_view_save ()

void
webkit_web_view_save (WebKitWebView *web_view,
                      WebKitSaveMode save_mode,
                      GCancellable *cancellable,
                      GAsyncReadyCallback callback,
                      gpointer user_data);

Asynchronously save the current web page associated to the WebKitWebView into a self-contained format using the mode specified in save_mode .

When the operation is finished, callback will be called. You can then call webkit_web_view_save_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

save_mode

the WebKitSaveMode specifying how the web page should be saved.

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

webkit_web_view_save_finish ()

GInputStream *
webkit_web_view_save_finish (WebKitWebView *web_view,
                             GAsyncResult *result,
                             GError **error);

Finish an asynchronous operation started with webkit_web_view_save().

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a GInputStream with the result of saving the current web page or NULL in case of error.

[transfer full]


webkit_web_view_save_to_file ()

void
webkit_web_view_save_to_file (WebKitWebView *web_view,
                              GFile *file,
                              WebKitSaveMode save_mode,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Asynchronously save the current web page associated to the WebKitWebView into a self-contained format using the mode specified in save_mode and writing it to file .

When the operation is finished, callback will be called. You can then call webkit_web_view_save_to_file_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

file

the GFile where the current web page should be saved to.

 

save_mode

the WebKitSaveMode specifying how the web page should be saved.

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

webkit_web_view_save_to_file_finish ()

gboolean
webkit_web_view_save_to_file_finish (WebKitWebView *web_view,
                                     GAsyncResult *result,
                                     GError **error);

Finish an asynchronous operation started with webkit_web_view_save_to_file().

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

TRUE if the web page was successfully saved to a file or FALSE otherwise.


webkit_web_view_download_uri ()

WebKitDownload *
webkit_web_view_download_uri (WebKitWebView *web_view,
                              const char *uri);

Requests downloading of the specified URI string for web_view .

Parameters

web_view

a WebKitWebView

 

uri

the URI to download

 

Returns

a new WebKitDownload representing the download operation.

[transfer full]


webkit_web_view_get_tls_info ()

gboolean
webkit_web_view_get_tls_info (WebKitWebView *web_view,
                              GTlsCertificate **certificate,
                              GTlsCertificateFlags *errors);

Retrieves the GTlsCertificate associated with the main resource of web_view , and the GTlsCertificateFlags showing what problems, if any, have been found with that certificate. If the connection is not HTTPS, this function returns FALSE. This function should be called after a response has been received from the server, so you can connect to “load-changed” and call this function when it's emitted with WEBKIT_LOAD_COMMITTED event.

Note that this function provides no information about the security of the web page if the current WebKitTLSErrorsPolicy is WEBKIT_TLS_ERRORS_POLICY_IGNORE, as subresources of the page may be controlled by an attacker. This function may safely be used to determine the security status of the current page only if the current WebKitTLSErrorsPolicy is WEBKIT_TLS_ERRORS_POLICY_FAIL, in which case subresources that fail certificate verification will be blocked.

Parameters

web_view

a WebKitWebView

 

certificate

return location for a GTlsCertificate.

[out][transfer none]

errors

return location for a GTlsCertificateFlags the verification status of certificate .

[out]

Returns

TRUE if the web_view connection uses HTTPS and a response has been received from the server, or FALSE otherwise.


webkit_web_view_get_snapshot ()

void
webkit_web_view_get_snapshot (WebKitWebView *web_view,
                              WebKitSnapshotRegion region,
                              WebKitSnapshotOptions options,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Asynchronously retrieves a snapshot of web_view for region . options specifies how the snapshot should be rendered.

When the operation is finished, callback will be called. You must call webkit_web_view_get_snapshot_finish() to get the result of the operation.

Parameters

web_view

a WebKitWebView

 

region

the WebKitSnapshotRegion for this snapshot

 

options

WebKitSnapshotOptions for the snapshot

 

cancellable

a GCancellable.

[allow-none]

callback

a GAsyncReadyCallback.

[scope async]

user_data

user data.

[closure]

webkit_web_view_get_snapshot_finish ()

cairo_surface_t *
webkit_web_view_get_snapshot_finish (WebKitWebView *web_view,
                                     GAsyncResult *result,
                                     GError **error);

Finishes an asynchronous operation started with webkit_web_view_get_snapshot().

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a cairo_surface_t with the retrieved snapshot or NULL in error.

[transfer full]


webkit_web_view_set_background_color ()

void
webkit_web_view_set_background_color (WebKitWebView *web_view,
                                      const GdkRGBA *rgba);

Sets the color that will be used to draw the web_view background before the actual contents are rendered. Note that if the web page loaded in web_view specifies a background color, it will take precedence over the rgba color. By default the web_view background color is opaque white. Note that the parent window must have a RGBA visual and “app-paintable” property set to TRUE for backgrounds colors to work.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
static void browser_window_set_background_color (BrowserWindow *window,
                                                 const GdkRGBA *rgba)
{
    WebKitWebView *web_view;
    GdkScreen *screen = gtk_window_get_screen (GTK_WINDOW (window));
    GdkVisual *rgba_visual = gdk_screen_get_rgba_visual (screen);

    if (!rgba_visual)
         return;

    gtk_widget_set_visual (GTK_WIDGET (window), rgba_visual);
    gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);

    web_view = browser_window_get_web_view (window);
    webkit_web_view_set_background_color (web_view, rgba);
}

Parameters

web_view

a WebKitWebView

 

rgba

a GdkRGBA

 

Since: 2.8


webkit_web_view_get_background_color ()

void
webkit_web_view_get_background_color (WebKitWebView *web_view,
                                      GdkRGBA *rgba);

Gets the color that is used to draw the web_view background before the actual contents are rendered. For more information see also webkit_web_view_set_background_color()

Parameters

web_view

a WebKitWebView

 

rgba

a GdkRGBA to fill in with the background color.

[out]

Since: 2.8


webkit_web_view_set_editable ()

void
webkit_web_view_set_editable (WebKitWebView *web_view,
                              gboolean editable);

Sets whether the user is allowed to edit the HTML document.

If editable is TRUE, web_view allows the user to edit the HTML document. If editable is FALSE, an element in web_view 's document can only be edited if the CONTENTEDITABLE attribute has been set on the element or one of its parent elements. By default a WebKitWebView is not editable.

Normally, a HTML document is not editable unless the elements within the document are editable. This function provides a way to make the contents of a WebKitWebView editable without altering the document or DOM structure.

Parameters

web_view

a WebKitWebView

 

editable

a gboolean indicating the editable state

 

Since: 2.8


webkit_web_view_is_editable ()

gboolean
webkit_web_view_is_editable (WebKitWebView *web_view);

webkit_web_view_get_editor_state ()

WebKitEditorState *
webkit_web_view_get_editor_state (WebKitWebView *web_view);

Gets the web editor state of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

the WebKitEditorState of the view.

[transfer none]

Since: 2.10


webkit_web_view_get_session_state ()

WebKitWebViewSessionState *
webkit_web_view_get_session_state (WebKitWebView *web_view);

Gets the current session state of web_view

Parameters

web_view

a WebKitWebView

 

Returns

a WebKitWebViewSessionState.

[transfer full]

Since: 2.12


webkit_web_view_restore_session_state ()

void
webkit_web_view_restore_session_state (WebKitWebView *web_view,
                                       WebKitWebViewSessionState *state);

Restore the web_view session state from state

Parameters

web_view

a WebKitWebView

 

state

a WebKitWebViewSessionState

 

Since: 2.12


webkit_web_view_get_main_resource ()

WebKitWebResource *
webkit_web_view_get_main_resource (WebKitWebView *web_view);

Return the main resource of web_view .

Parameters

web_view

a WebKitWebView

 

Returns

the main WebKitWebResource of the view or NULL if nothing has been loaded.

[transfer none]


webkit_web_view_send_message_to_page ()

void
webkit_web_view_send_message_to_page (WebKitWebView *web_view,
                                      WebKitUserMessage *message,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Send message to the WebKitWebPage corresponding to web_view . If message is floating, it's consumed.

If you don't expect any reply, or you simply want to ignore it, you can pass NULL as callback . When the operation is finished, callback will be called. You can then call webkit_web_view_send_message_to_page_finish() to get the message reply.

Parameters

web_view

a WebKitWebView

 

message

a WebKitUserMessage

 

cancellable

a GCancellable or NULL to ignore.

[nullable]

callback

(nullable): A GAsyncReadyCallback to call when the request is satisfied or NULL.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.28


webkit_web_view_send_message_to_page_finish ()

WebKitUserMessage *
webkit_web_view_send_message_to_page_finish
                               (WebKitWebView *web_view,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_web_view_send_message_to_page().

Parameters

web_view

a WebKitWebView

 

result

a GAsyncResult

 

error

return location for error or NULL to ignor

 

Returns

a WebKitUserMessage with the reply or NULL in case of error.

[transfer full]

Since: 2.28


webkit_web_view_set_input_method_context ()

void
webkit_web_view_set_input_method_context
                               (WebKitWebView *web_view,
                                WebKitInputMethodContext *context);

Set the WebKitInputMethodContext to be used by web_view , or NULL to not use any input method. Note that the same WebKitInputMethodContext can't be set on more than one WebKitWebView at the same time.

Parameters

web_view

a WebKitWebView

 

context

the WebKitInputMethodContext to set, or NULL.

[nullable]

Since: 2.28


webkit_web_view_get_input_method_context ()

WebKitInputMethodContext *
webkit_web_view_get_input_method_context
                               (WebKitWebView *web_view);

Get the WebKitInputMethodContext currently in use by web_view , or NULL if no input method is being used.

Parameters

web_view

a WebKitWebView

 

Returns

a WebKitInputMethodContext, or NULL.

[nullable][transfer none]

Since: 2.28


webkit_web_view_get_website_policies ()

WebKitWebsitePolicies *
webkit_web_view_get_website_policies (WebKitWebView *web_view);

Gets the default website policies set on construction in the web_view . These can be overridden on a per-origin basis via the “decide-policy” signal handler.

See also webkit_policy_decision_use_with_policies().

Parameters

web_view

a WebKitWebView

 

Returns

the default WebKitWebsitePolicies associated with the view.

[transfer none]

Since: 2.30


webkit_web_view_get_is_web_process_responsive ()

gboolean
webkit_web_view_get_is_web_process_responsive
                               (WebKitWebView *web_view);

webkit_web_view_terminate_web_process ()

void
webkit_web_view_terminate_web_process (WebKitWebView *web_view);

Terminates the web process associated to web_view . When the web process gets terminated using this method, the “web-process-terminated” signal is emitted with WEBKIT_WEB_PROCESS_TERMINATED_BY_API as the reason for termination.

Parameters

web_view

a WebKitWebView

 

Since: 2.34


webkit_web_view_set_cors_allowlist ()

void
webkit_web_view_set_cors_allowlist (WebKitWebView *web_view,
                                    const gchar * const *allowlist);

Sets the allowlist for which Cross-Origin Resource Sharing checks are disabled in web_view . URI patterns must be of the form [protocol]://[host]/[path], each component may contain the wildcard character (*) to represent zero or more other characters. All three components are required and must not be omitted from the URI patterns.

Disabling CORS checks permits resources from other origins to load allowlisted resources. It does not permit the allowlisted resources to load resources from other origins.

If this function is called multiple times, only the allowlist set by the most recent call will be effective.

Parameters

web_view

a WebKitWebView

 

allowlist

an allowlist of URI patterns, or NULL.

[array zero-terminated=1][element-type utf8][transfer none][nullable]

Since: 2.34


webkit_web_view_get_camera_capture_state ()

WebKitMediaCaptureState
webkit_web_view_get_camera_capture_state
                               (WebKitWebView *web_view);

Get the camera capture state of a WebKitWebView.

Parameters

web_view

a WebKitWebView

 

Returns

The WebKitMediaCaptureState of the camera device. If “enable-mediastream” is FALSE, this method will return WEBKIT_MEDIA_CAPTURE_STATE_NONE.

Since: 2.34


webkit_web_view_get_microphone_capture_state ()

WebKitMediaCaptureState
webkit_web_view_get_microphone_capture_state
                               (WebKitWebView *web_view);

Get the microphone capture state of a WebKitWebView.

Parameters

web_view

a WebKitWebView

 

Returns

The WebKitMediaCaptureState of the microphone device. If “enable-mediastream” is FALSE, this method will return WEBKIT_MEDIA_CAPTURE_STATE_NONE.

Since: 2.34


webkit_web_view_set_camera_capture_state ()

void
webkit_web_view_set_camera_capture_state
                               (WebKitWebView *web_view,
                                WebKitMediaCaptureState state);

Set the camera capture state of a WebKitWebView.

If “enable-mediastream” is FALSE, this method will have no visible effect. Once the state of the device has been set to WEBKIT_MEDIA_CAPTURE_STATE_NONE it cannot be changed anymore. The page can however request capture again using the mediaDevices API.

Parameters

web_view

a WebKitWebView

 

state

a WebKitMediaCaptureState

 

Since: 2.34


webkit_web_view_set_microphone_capture_state ()

void
webkit_web_view_set_microphone_capture_state
                               (WebKitWebView *web_view,
                                WebKitMediaCaptureState state);

Set the microphone capture state of a WebKitWebView.

If “enable-mediastream” is FALSE, this method will have no visible effect. Once the state of the device has been set to WEBKIT_MEDIA_CAPTURE_STATE_NONE it cannot be changed anymore. The page can however request capture again using the mediaDevices API.

Parameters

web_view

a WebKitWebView

 

state

a WebKitMediaCaptureState

 

Since: 2.34


webkit_web_view_get_display_capture_state ()

WebKitMediaCaptureState
webkit_web_view_get_display_capture_state
                               (WebKitWebView *web_view);

Get the display capture state of a WebKitWebView.

Parameters

web_view

a WebKitWebView

 

Returns

The WebKitMediaCaptureState of the display device. If “enable-mediastream” is FALSE, this method will return WEBKIT_MEDIA_CAPTURE_STATE_NONE.

Since: 2.34


webkit_web_view_set_display_capture_state ()

void
webkit_web_view_set_display_capture_state
                               (WebKitWebView *web_view,
                                WebKitMediaCaptureState state);

Set the display capture state of a WebKitWebView.

If “enable-mediastream” is FALSE, this method will have no visible effect. Once the state of the device has been set to WEBKIT_MEDIA_CAPTURE_STATE_NONE it cannot be changed anymore. The page can however request capture again using the mediaDevices API.

Parameters

web_view

a WebKitWebView

 

state

a WebKitMediaCaptureState

 

Since: 2.34


webkit_javascript_result_ref ()

WebKitJavascriptResult *
webkit_javascript_result_ref (WebKitJavascriptResult *js_result);

Atomically increments the reference count of js_result by one. This function is MT-safe and may be called from any thread.

Parameters

js_result

a WebKitJavascriptResult