### Class

# WebKit WebContext

unstable since: 6.0

#### Description [src]

    final class WebKit.WebContext : GObject.Object
    {
      /* No available fields */
    }

Manages aspects common to all `WebKitWebView`s

The `WebKitWebContext` manages all aspects common to all `WebKitWebView`s.

You can define the `WebKitCacheModel` with webkit_web_context_set_cache_model(), depending on the needs of your application. You can access the `WebKitSecurityManager` to specify the behaviour of your application regarding security using webkit_web_context_get_security_manager().

It is also possible to change your preferred language or enable spell checking, using webkit_web_context_set_preferred_languages(), `webkit_web_context_set_spell_checking_languages()` and webkit_web_context_set_spell_checking_enabled().

You can use `webkit_web_context_register_uri_scheme()` to register custom URI schemes, and manage several other settings.

TLS certificate validation failure is now treated as a transport error by default. To handle TLS failures differently, you can connect to `WebKitWebView::load-failed-with-tls-errors`. Alternatively, you can use `webkit_web_context_set_tls_errors_policy()` to set the policy `WEBKIT_TLS_ERRORS_POLICY_IGNORE`; however, this is not appropriate for Internet applications.

Available since: 6.0

#### Ancestors

- GObject

#### Constructors

###### webkit_web_context_new

Create a new `WebKitWebContext`.

since: 2.8

#### Functions

###### webkit_web_context_get_default

Gets the default web context.

unstable since: 6.0

#### Instance methods

###### webkit_web_context_add_path_to_sandbox

Adds a path to be mounted in the sandbox.

since: 2.26

###### webkit_web_context_get_cache_model

Returns the current cache model.

unstable since: 6.0

###### webkit_web_context_get_geolocation_manager

Get the `WebKitGeolocationManager` of `context`.

since: 2.26

###### webkit_web_context_get_network_session_for_automation

Get the `WebKitNetworkSession` used for automation sessions started in `context`.

since: 2.40

###### webkit_web_context_get_security_manager

Get the `WebKitSecurityManager` of `context`.

unstable since: 6.0

###### webkit_web_context_get_spell_checking_enabled

Get whether spell checking feature is currently enabled.

unstable since: 6.0

###### webkit_web_context_get_spell_checking_languages

Get the the list of spell checking languages.

unstable since: 6.0

###### webkit_web_context_get_time_zone_override

Get the `WebKitWebContext:time-zone-override` property.

since: 2.38

###### webkit_web_context_initialize_notification_permissions

Sets initial desktop notification permissions for the `context`.

since: 2.16

###### webkit_web_context_is_automation_allowed

Get whether automation is allowed in `context`.

since: 2.18

###### webkit_web_context_register_uri_scheme

Register `scheme` in `context`.

unstable since: 6.0

###### webkit_web_context_send_message_to_all_extensions

Send `message` to all web process extensions associated to `context`.

since: 2.28

###### webkit_web_context_set_automation_allowed

Set whether automation is allowed in `context`.

since: 2.18

###### webkit_web_context_set_cache_model

Specifies a usage model for WebViews.

unstable since: 6.0

###### webkit_web_context_set_preferred_languages

Set the list of preferred languages.

unstable since: 6.0

###### webkit_web_context_set_spell_checking_enabled

Enable or disable the spell checking feature.

unstable since: 6.0

###### webkit_web_context_set_spell_checking_languages

Set the list of spell checking languages to be used for spell checking.

unstable since: 6.0

###### webkit_web_context_set_web_process_extensions_directory

Set the directory where WebKit will look for web process extensions.

unstable since: 6.0

###### webkit_web_context_set_web_process_extensions_initialization_user_data

Set user data to be passed to Web Extensions on initialization.

since: 2.4

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### WebKit.WebContext:memory-pressure-settings

The `WebKitMemoryPressureSettings` applied to the web processes created by this context.

since: 2.34

###### WebKit.WebContext:time-zone-override

The timezone override for this web context. Setting this property provides a better alternative to configure the timezone information for all webviews managed by the WebContext. The other, less optimal, approach is to globally set the TZ environment variable in the process before creating the context. However this approach might not be very convenient and can have side-effects in your application.

since: 2.38

#### Signals

###### WebKit.WebContext::automation-started

This signal is emitted when a new automation request is made. Note that it will never be emitted if automation is not enabled in `context`, see `webkit_web_context_set_automation_allowed()` for more details.

since: 2.18

###### WebKit.WebContext::initialize-notification-permissions

This signal is emitted when a `WebKitWebContext` needs to set initial notification permissions for a web process. It is emitted when a new web process is about to be launched, and signals the most appropriate moment to use webkit_web_context_initialize_notification_permissions(). If no notification permissions have changed since the last time this signal was emitted, then there is no need to call `webkit_web_context_initialize_notification_permissions()` again.

since: 2.16

###### WebKit.WebContext::initialize-web-process-extensions

This signal is emitted when a new web process is about to be launched. It signals the most appropriate moment to use `webkit_web_context_set_web_process_extensions_initialization_user_data()` and webkit_web_context_set_web_process_extensions_directory().

since: 2.4

###### WebKit.WebContext::user-message-received

This signal is emitted when a `WebKitUserMessage` is received from a web process extension. You can reply to the message using webkit_user_message_send_reply().

since: 2.28

##### Signals inherited from GObject (1)

###### GObject::notify

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.

since: 2.0

#### Class structure

    struct WebKitWebContextClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.