Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- allowTlsCertificateForHost
- downloadUri
- getCookieManager
- getDefault
- getItpEnabled
- getItpSummary
- getItpSummaryFinish
- getPersistentCredentialStorageEnabled
- getTlsErrorsPolicy
- getWebsiteDataManager
- isEphemeral
- new
- newEphemeral
- prefetchDns
- setItpEnabled
- setMemoryPressureSettings
- setPersistentCredentialStorageEnabled
- setProxySettings
- setTlsErrorsPolicy
- Properties
- Signals
Manages network configuration.
Since: 2.40
Synopsis
- newtype NetworkSession = NetworkSession (ManagedPtr NetworkSession)
- class (GObject o, IsDescendantOf NetworkSession o) => IsNetworkSession o
- toNetworkSession :: (MonadIO m, IsNetworkSession o) => o -> m NetworkSession
- networkSessionAllowTlsCertificateForHost :: (HasCallStack, MonadIO m, IsNetworkSession a, IsTlsCertificate b) => a -> b -> Text -> m ()
- networkSessionDownloadUri :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> Text -> m Download
- networkSessionGetCookieManager :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> m CookieManager
- networkSessionGetDefault :: (HasCallStack, MonadIO m) => m NetworkSession
- networkSessionGetItpEnabled :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> m Bool
- networkSessionGetItpSummary :: (HasCallStack, MonadIO m, IsNetworkSession a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- networkSessionGetItpSummaryFinish :: (HasCallStack, MonadIO m, IsNetworkSession a, IsAsyncResult b) => a -> b -> m [ITPThirdParty]
- networkSessionGetPersistentCredentialStorageEnabled :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> m Bool
- networkSessionGetTlsErrorsPolicy :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> m TLSErrorsPolicy
- networkSessionGetWebsiteDataManager :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> m WebsiteDataManager
- networkSessionIsEphemeral :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> m Bool
- networkSessionNew :: (HasCallStack, MonadIO m) => Maybe Text -> Maybe Text -> m NetworkSession
- networkSessionNewEphemeral :: (HasCallStack, MonadIO m) => m NetworkSession
- networkSessionPrefetchDns :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> Text -> m ()
- networkSessionSetItpEnabled :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> Bool -> m ()
- networkSessionSetMemoryPressureSettings :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m ()
- networkSessionSetPersistentCredentialStorageEnabled :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> Bool -> m ()
- networkSessionSetProxySettings :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> NetworkProxyMode -> Maybe NetworkProxySettings -> m ()
- networkSessionSetTlsErrorsPolicy :: (HasCallStack, MonadIO m, IsNetworkSession a) => a -> TLSErrorsPolicy -> m ()
- constructNetworkSessionCacheDirectory :: (IsNetworkSession o, MonadIO m) => Text -> m (GValueConstruct o)
- constructNetworkSessionDataDirectory :: (IsNetworkSession o, MonadIO m) => Text -> m (GValueConstruct o)
- constructNetworkSessionIsEphemeral :: (IsNetworkSession o, MonadIO m) => Bool -> m (GValueConstruct o)
- getNetworkSessionIsEphemeral :: (MonadIO m, IsNetworkSession o) => o -> m Bool
- type NetworkSessionDownloadStartedCallback = Download -> IO ()
- afterNetworkSessionDownloadStarted :: (IsNetworkSession a, MonadIO m) => a -> ((?self :: a) => NetworkSessionDownloadStartedCallback) -> m SignalHandlerId
- onNetworkSessionDownloadStarted :: (IsNetworkSession a, MonadIO m) => a -> ((?self :: a) => NetworkSessionDownloadStartedCallback) -> m SignalHandlerId
Exported types
newtype NetworkSession Source #
Memory-managed wrapper type.
NetworkSession (ManagedPtr NetworkSession) |
Instances
Eq NetworkSession Source # | |
Defined in GI.WebKit.Objects.NetworkSession (==) :: NetworkSession -> NetworkSession -> Bool # (/=) :: NetworkSession -> NetworkSession -> Bool # | |
GObject NetworkSession Source # | |
Defined in GI.WebKit.Objects.NetworkSession | |
ManagedPtrNewtype NetworkSession Source # | |
Defined in GI.WebKit.Objects.NetworkSession toManagedPtr :: NetworkSession -> ManagedPtr NetworkSession | |
TypedObject NetworkSession Source # | |
Defined in GI.WebKit.Objects.NetworkSession | |
HasParentTypes NetworkSession Source # | |
Defined in GI.WebKit.Objects.NetworkSession | |
IsGValue (Maybe NetworkSession) Source # | Convert |
Defined in GI.WebKit.Objects.NetworkSession gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe NetworkSession -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe NetworkSession) | |
type ParentTypes NetworkSession Source # | |
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
(GObject o, IsDescendantOf NetworkSession o) => IsNetworkSession o Source # | |
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
Click to display all available methods, including inherited ones
Methods
allowTlsCertificateForHost, bindProperty, bindPropertyFull, downloadUri, forceFloating, freezeNotify, getv, isEphemeral, isFloating, notify, notifyByPspec, prefetchDns, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCookieManager, getData, getItpEnabled, getItpSummary, getItpSummaryFinish, getPersistentCredentialStorageEnabled, getProperty, getQdata, getTlsErrorsPolicy, getWebsiteDataManager.
Setters
setData, setDataFull, setItpEnabled, setPersistentCredentialStorageEnabled, setProperty, setProxySettings, setTlsErrorsPolicy.
allowTlsCertificateForHost
networkSessionAllowTlsCertificateForHost Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a, IsTlsCertificate b) | |
=> a |
|
-> b |
|
-> Text |
|
-> m () |
Ignore further TLS errors on the host
for the certificate present in info
.
Since: 2.40
downloadUri
networkSessionDownloadUri Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> Text |
|
-> m Download | Returns: a new |
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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> m CookieManager | Returns: a |
Get the CookieManager
of session
.
Since: 2.40
getDefault
networkSessionGetDefault Source #
:: (HasCallStack, MonadIO m) | |
=> m NetworkSession | Returns: a |
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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> m Bool |
Get whether Intelligent Tracking Prevention (ITP) is enabled or not.
Since: 2.40
getItpSummary
networkSessionGetItpSummary Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m [ITPThirdParty] | Returns: a |
Finish an asynchronous operation started with networkSessionGetItpSummary
.
Since: 2.40
getPersistentCredentialStorageEnabled
networkSessionGetPersistentCredentialStorageEnabled Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> m Bool | Returns: |
Get whether persistent credential storage is enabled or not.
See also networkSessionSetPersistentCredentialStorageEnabled
.
Since: 2.40
getTlsErrorsPolicy
networkSessionGetTlsErrorsPolicy Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> m TLSErrorsPolicy | Returns: a |
Get the TLS errors policy of session
.
Since: 2.40
getWebsiteDataManager
networkSessionGetWebsiteDataManager Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> m WebsiteDataManager | Returns: a |
Get the WebsiteDataManager
of session
.
Since: 2.40
isEphemeral
networkSessionIsEphemeral Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> m Bool |
Get whether session
is ephemeral.
A NetworkSession
is ephemeral when its WebsiteDataManager
is ephemeral.
See WebsiteDataManager:isEphemeral for more details.
Since: 2.40
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Maybe Text |
|
-> m NetworkSession | Returns: the newly created |
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 #
:: (HasCallStack, MonadIO m) | |
=> m NetworkSession | Returns: a new ephemeral |
Creates a new NetworkSession
with an ephemeral WebsiteDataManager
.
Since: 2.40
prefetchDns
networkSessionPrefetchDns Source #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> a |
|
-> NetworkProxyMode |
|
-> Maybe NetworkProxySettings |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsNetworkSession a) | |
=> 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 #
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