webkit.web_context

Module for [WebContext] class

Types 3

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.WebContext.setCacheModel, 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.WebContext.getSecurityManager.

It is also possible to change your preferred language or enable spell checking, using webkit.web_context.WebContext.setPreferredLanguages, webkit.web_context.WebContext.setSpellCheckingLanguages and webkit.web_context.WebContext.setSpellCheckingEnabled.

You can use webkit.web_context.WebContext.registerUriScheme 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.types.TLSErrorsPolicy.Ignore; however, this is not appropriate for Internet applications.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
WebContext self() nothrowReturns `this`, for use in `with` statements.
WebContextGidBuilder builder() static nothrowGet builder for [webkit.web_context.WebContext] Returns: New builder object
string timeZoneOverride() @property nothrowGet `timeZoneOverride` property. Returns: The timezone override for this web context. Setting this property provides a better alternative to configure the timezone information for all webviews mana...
webkit.web_context.WebContext getDefault() static nothrowGets the default web context. Returns: a #WebKitWebContext
void addPathToSandbox(string path, bool readOnly) nothrowAdds a path to be mounted in the sandbox.
webkit.types.CacheModel getCacheModel() nothrowReturns the current cache model.
webkit.geolocation_manager.GeolocationManager getGeolocationManager() nothrowGet the #WebKitGeolocationManager of context. Returns: the #WebKitGeolocationManager of context.
webkit.network_session.NetworkSession getNetworkSessionForAutomation() nothrowGet the #WebKitNetworkSession used for automation sessions started in context. Returns: a #WebKitNetworkSession, or null if automation is not enabled
webkit.security_manager.SecurityManager getSecurityManager() nothrowGet the #WebKitSecurityManager of context. Returns: the #WebKitSecurityManager of context.
bool getSpellCheckingEnabled() nothrowGet whether spell checking feature is currently enabled. Returns: true If spell checking is enabled, or false otherwise.
string[] getSpellCheckingLanguages() nothrowGet the the list of spell checking languages.
string getTimeZoneOverride() nothrowGet the #WebKitWebContext:time-zone-override property. Returns:
void initializeNotificationPermissions(webkit.security_origin.SecurityOrigin[] allowedOrigins, webkit.security_origin.SecurityOrigin[] disallowedOrigins) nothrowSets initial desktop notification permissions for the context.
bool isAutomationAllowed() nothrowGet whether automation is allowed in context.
void registerUriScheme(string scheme, webkit.types.URISchemeRequestCallback callback) nothrowRegister scheme in context.
void sendMessageToAllExtensions(webkit.user_message.UserMessage message) nothrowSend message to all web process extensions associated to context.
void setAutomationAllowed(bool allowed) nothrowSet whether automation is allowed in context.
void setCacheModel(webkit.types.CacheModel cacheModel) nothrowSpecifies a usage model for WebViews.
void setPreferredLanguages(string[] languages = null) nothrowSet the list of preferred languages.
void setSpellCheckingEnabled(bool enabled) nothrowEnable or disable the spell checking feature.
void setSpellCheckingLanguages(string[] languages) nothrowSet the list of spell checking languages to be used for spell checking.
void setWebProcessExtensionsDirectory(string directory) nothrowSet the directory where WebKit will look for web process extensions.
void setWebProcessExtensionsInitializationUserData(glib.variant.Variant userData) nothrowSet user data to be passed to Web Extensions on initialization.
gulong connectAutomationStarted(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : webkit.automation_session.AutomationSession))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : webkit.web_context.WebContext))) && Parameters!T.length < 3) nothrowConnect to `AutomationStarted` signal.
gulong connectInitializeNotificationPermissions(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : webkit.web_context.WebContext))) && Parameters!T.length < 2) nothrowConnect to `InitializeNotificationPermissions` signal.
gulong connectInitializeWebProcessExtensions(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : webkit.web_context.WebContext))) && Parameters!T.length < 2) nothrowConnect to `InitializeWebProcessExtensions` signal.
gulong connectUserMessageReceived(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : webkit.user_message.UserMessage))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : webkit.web_context.WebContext))) && Parameters!T.length < 3) nothrowConnect to `UserMessageReceived` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Create a new #WebKitWebContext. Returns: a newly created #WebKitWebContext

Fluent builder implementation template for webkit.web_context.WebContext

Methods
T memoryPressureSettings(webkit.memory_pressure_settings.MemoryPressureSettings propval) nothrowSet `memoryPressureSettings` property. Params: propval = The #WebKitMemoryPressureSettings applied to the web processes created by this context. Returns: Builder instance for fluent chaining
T timeZoneOverride(string propval) nothrowSet `timeZoneOverride` property. Params: propval = The timezone override for this web context. Setting this property provides a better alternative to configure the timezone information for all webv...
Methods
WebContext build() nothrowCreate object from builder. Returns: New object