gi-webkit-6.0.2: WebKit bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit.Objects.NetworkSession

Description

Manages network configuration.

Since: 2.40

Synopsis

Exported types

newtype NetworkSession Source #

Memory-managed wrapper type.

Constructors

NetworkSession (ManagedPtr NetworkSession) 

Instances

Instances details
Eq NetworkSession Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

GObject NetworkSession Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

ManagedPtrNewtype NetworkSession Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

TypedObject NetworkSession Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

Methods

glibType :: IO GType

HasParentTypes NetworkSession Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

IsGValue (Maybe NetworkSession) Source #

Convert NetworkSession to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.WebKit.Objects.NetworkSession

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe NetworkSession -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe NetworkSession)

type ParentTypes NetworkSession Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

type ParentTypes NetworkSession = '[Object]

class (GObject o, IsDescendantOf NetworkSession o) => IsNetworkSession o Source #

Type class for types which can be safely cast to NetworkSession, for instance with toNetworkSession.

Instances

Instances details
(GObject o, IsDescendantOf NetworkSession o) => IsNetworkSession o Source # 
Instance details

Defined in GI.WebKit.Objects.NetworkSession

toNetworkSession :: (MonadIO m, IsNetworkSession o) => o -> m NetworkSession Source #

Cast to NetworkSession, for types for which this is known to be safe. For general casts, use castTo.

Methods

allowTlsCertificateForHost

networkSessionAllowTlsCertificateForHost Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a, IsTlsCertificate b) 
=> a

session: a NetworkSession

-> b

certificate: a TlsCertificate

-> Text

host: the host for which a certificate is to be allowed

-> m () 

Ignore further TLS errors on the host for the certificate present in info.

Since: 2.40

downloadUri

networkSessionDownloadUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> Text

uri: the URI to download

-> m Download

Returns: a new Download representing the download operation.

Requests downloading of the specified URI string.

The download operation will not be associated to any WebView, if you are interested in starting a download from a particular WebView use webViewDownloadUri instead.

Since: 2.40

getCookieManager

networkSessionGetCookieManager Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> m CookieManager

Returns: a CookieManager

Get the CookieManager of session.

Since: 2.40

getDefault

networkSessionGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m NetworkSession

Returns: a NetworkSession

Get the default network session. The default network session is created using networkSessionNew and passing Nothing as data and cache directories.

Since: 2.40

getItpEnabled

networkSessionGetItpEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> m Bool

Returns: True if ITP is enabled, or False otherwise.

Get whether Intelligent Tracking Prevention (ITP) is enabled or not.

Since: 2.40

getItpSummary

networkSessionGetItpSummary Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a, IsCancellable b) 
=> a

session: a NetworkSession

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously get the list of ITPThirdParty seen for session.

Every ITPThirdParty contains the list of ITPFirstParty under which it has been seen.

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

Since: 2.40

getItpSummaryFinish

networkSessionGetItpSummaryFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a, IsAsyncResult b) 
=> a

session: a NetworkSession

-> b

result: a AsyncResult

-> m [ITPThirdParty]

Returns: a List of ITPThirdParty. You must free the List with g_list_free() and unref the ITPThirdPartys with iTPThirdPartyUnref when you're done with them. (Can throw GError)

Finish an asynchronous operation started with networkSessionGetItpSummary.

Since: 2.40

getPersistentCredentialStorageEnabled

networkSessionGetPersistentCredentialStorageEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> m Bool

Returns: True if persistent credential storage is enabled, or False otherwise.

Get whether persistent credential storage is enabled or not.

See also networkSessionSetPersistentCredentialStorageEnabled.

Since: 2.40

getTlsErrorsPolicy

networkSessionGetTlsErrorsPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> m TLSErrorsPolicy

Returns: a TLSErrorsPolicy

Get the TLS errors policy of session.

Since: 2.40

getWebsiteDataManager

isEphemeral

networkSessionIsEphemeral Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> m Bool

Returns: True if session is pehmeral, or False otherwise

Get whether session is ephemeral. A NetworkSession is ephemeral when its WebsiteDataManager is ephemeral. See WebsiteDataManager:isEphemeral for more details.

Since: 2.40

new

networkSessionNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

dataDirectory: a base directory for data, or Nothing

-> Maybe Text

cacheDirectory: a base directory for caches, or Nothing

-> m NetworkSession

Returns: the newly created NetworkSession

Creates a new NetworkSession with a persistent WebsiteDataManager. The parameters dataDirectory and cacheDirectory will be used as construct properties of the WebsiteDataManager of the network session. Note that if Nothing is passed, the default directory will be passed to WebsiteDataManager so that websiteDataManagerGetBaseDataDirectory and websiteDataManagerGetBaseCacheDirectory always return a value for non ephemeral sessions.

It must be passed as construct parameter of a WebView.

Since: 2.40

newEphemeral

networkSessionNewEphemeral Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m NetworkSession

Returns: a new ephemeral NetworkSession.

Creates a new NetworkSession with an ephemeral WebsiteDataManager.

Since: 2.40

prefetchDns

networkSessionPrefetchDns Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> Text

hostname: a hostname to be resolved

-> m () 

Resolve the domain name of the given hostname in advance, so that if a URI of hostname is requested the load will be performed more quickly.

Since: 2.40

setItpEnabled

networkSessionSetItpEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> Bool

enabled: value to set

-> m () 

Enable or disable Intelligent Tracking Prevention (ITP).

When ITP is enabled resource load statistics are collected and used to decide whether to allow or block third-party cookies and prevent user tracking. Note that while ITP is enabled the accept policy CookieAcceptPolicyNoThirdParty is ignored and CookieAcceptPolicyAlways is used instead. See also webkit_cookie_session_set_accept_policy().

Since: 2.40

setMemoryPressureSettings

networkSessionSetMemoryPressureSettings Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> MemoryPressureSettings

settings: a WebKitMemoryPressureSettings.

-> m () 

Sets settings as the MemoryPressureSettings.

Sets settings as the MemoryPressureSettings to be used by the network process created by any instance of NetworkSession after this function is called.

Be sure to call this function before creating any NetworkSession.

The periodic check for used memory is disabled by default on network processes. This will be enabled only if custom settings have been set using this function. After that, in order to remove the custom settings and disable the periodic check, this function must be called passing Nothing as the value of settings.

Since: 2.40

setPersistentCredentialStorageEnabled

networkSessionSetPersistentCredentialStorageEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> Bool

enabled: value to set

-> m () 

Enable or disable persistent credential storage.

When enabled, which is the default for non-ephemeral sessions, the network process will try to read and write HTTP authentiacation credentials from persistent storage.

Since: 2.40

setProxySettings

networkSessionSetProxySettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> NetworkProxyMode

proxyMode: a NetworkProxyMode

-> Maybe NetworkProxySettings

proxySettings: a NetworkProxySettings, or Nothing

-> m () 

Set the network proxy settings to be used by connections started in session session.

By default NetworkProxyModeDefault is used, which means that the system settings will be used (proxyResolverGetDefault). If you want to override the system default settings, you can either use NetworkProxyModeNoProxy to make sure no proxies are used at all, or NetworkProxyModeCustom to provide your own proxy settings. When proxyMode is NetworkProxyModeCustom proxySettings must be a valid NetworkProxySettings; otherwise, proxySettings must be Nothing.

Since: 2.40

setTlsErrorsPolicy

networkSessionSetTlsErrorsPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkSession a) 
=> a

session: a NetworkSession

-> TLSErrorsPolicy

policy: a TLSErrorsPolicy

-> m () 

Set the TLS errors policy of session as policy.

Since: 2.40

Properties

cacheDirectory

The base caches directory used to create the WebsiteDataManager. If Nothing, a default location will be used.

Since: 2.40

constructNetworkSessionCacheDirectory :: (IsNetworkSession o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cache-directory” property. This is rarely needed directly, but it is used by new.

dataDirectory

The base data directory used to create the WebsiteDataManager. If Nothing, a default location will be used.

Since: 2.40

constructNetworkSessionDataDirectory :: (IsNetworkSession o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “data-directory” property. This is rarely needed directly, but it is used by new.

isEphemeral

Whether to create an ephermeral WebsiteDataManager for the session.

Since: 2.40

constructNetworkSessionIsEphemeral :: (IsNetworkSession o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-ephemeral” property. This is rarely needed directly, but it is used by new.

getNetworkSessionIsEphemeral :: (MonadIO m, IsNetworkSession o) => o -> m Bool Source #

Get the value of the “is-ephemeral” property. When overloading is enabled, this is equivalent to

get networkSession #isEphemeral

Signals

downloadStarted

type NetworkSessionDownloadStartedCallback Source #

Arguments

 = Download

download: the Download associated with this event

-> IO () 

This signal is emitted when a new download request is made.

Since: 2.40

afterNetworkSessionDownloadStarted :: (IsNetworkSession a, MonadIO m) => a -> ((?self :: a) => NetworkSessionDownloadStartedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the downloadStarted signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after networkSession #downloadStarted callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onNetworkSessionDownloadStarted :: (IsNetworkSession a, MonadIO m) => a -> ((?self :: a) => NetworkSessionDownloadStartedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the downloadStarted signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on networkSession #downloadStarted callback