1.23 <WebKitNetworkSession>

Class: <WebKitNetworkSession>

It derives from <GObject>.

Manages network configuration.

Properties

Property: network-session:cache-directory self

The base caches directory used to create the <WebKitWebsiteDataManager>. If #f, a default location will be used.

Its value is a string, or #f.

It can only be set when the object is made, with #:cache-directory. It cannot be read.

Property: network-session:data-directory self

The base data directory used to create the <WebKitWebsiteDataManager>. If #f, a default location will be used.

Its value is a string, or #f.

It can only be set when the object is made, with #:data-directory. It cannot be read.

Property: network-session:is-ephemeral self

Whether to create an ephermeral <WebKitWebsiteDataManager> for the session.

Its value is a boolean.

It can only be set when the object is made, with #:is-ephemeral.

Procedures

Method: network-session:allow-tls-certificate-for-host self certificate host
Method: allow-tls-certificate-for-host self certificate host

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

If host is an IPv6 address, it should not be surrounded by brackets. This expectation matches uri:get-host.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

certificate

Passed: a <GTlsCertificate>.

a <GTlsCertificate>

host

Passed: a string.

the host for which a certificate is to be allowed

Method: network-session:download-uri self uri ⇒ %return
Method: download-uri self uri ⇒ %return

Requests downloading of the specified URI string.

The download operation will not be associated to any <WebKitWebView>, if you are interested in starting a download from a particular <WebKitWebView> use web-view:download-uri instead.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

uri

Passed: a string.

the URI to download

%return

Returned: a <WebKitDownload>.

a new <WebKitDownload> representing the download operation.

Method: network-session:get-cookie-manager self ⇒ %return
Method: get-cookie-manager self ⇒ %return

Get the <WebKitCookieManager> of self.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

%return

Returned: a <WebKitCookieManager>.

a <WebKitCookieManager>

Procedure: network-session:get-default ⇒ %return

Get the default network session. The default network session is created using network-session:new and passing #f as data and cache directories.

%return

Returned: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

Method: network-session:get-itp-enabled? self ⇒ %return
Method: get-itp-enabled? self ⇒ %return

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

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

%return

Returned: a boolean.

#t if ITP is enabled, or #f otherwise.

Method: network-session:get-itp-summary self [cancellable] [callback]
Method: get-itp-summary self [cancellable] [callback]

Asynchronously get the list of <WebKitITPThirdParty> seen for self.

Every <WebKitITPThirdParty> contains the list of <WebKitITPFirstParty> under which it has been seen.

When the operation is finished, callback will be called. You can then call network-session:get-itp-summary-finish to get the result of the operation.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: network-session:get-itp-summary-finish self result ⇒ %return
Method: get-itp-summary-finish self result ⇒ %return

Finish an asynchronous operation started with network-session:get-itp-summary.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a list, each a <WebKitITPThirdParty>.

a GList of <WebKitITPThirdParty>. You must free the GList with g_list_free() and unref the <WebKitITPThirdParty><!– –>s with itpthird-party:unref when you’re done with them.

Method: network-session:get-persistent-credential-storage-enabled? self ⇒ %return
Method: get-persistent-credential-storage-enabled? self ⇒ %return

Get whether persistent credential storage is enabled or not.

See also network-session:set-persistent-credential-storage-enabled.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

%return

Returned: a boolean.

#t if persistent credential storage is enabled, or #f otherwise.

Method: network-session:get-tls-errors-policy self ⇒ %return
Method: get-tls-errors-policy self ⇒ %return

Get the TLS errors policy of self.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

%return

Returned: a <WebKitTLSErrorsPolicy>.

a <WebKitTLSErrorsPolicy>

Method: network-session:get-website-data-manager self ⇒ %return
Method: get-website-data-manager self ⇒ %return

Get the <WebKitWebsiteDataManager> of self.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

%return

Returned: a <WebKitWebsiteDataManager>.

a <WebKitWebsiteDataManager>

Method: network-session:is-ephemeral? self ⇒ %return
Method: is-ephemeral? self ⇒ %return

Get whether self is ephemeral. A <WebKitNetworkSession> is ephemeral when its <WebKitWebsiteDataManager> is ephemeral. See website-data-manager:is-ephemeral for more details.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

%return

Returned: a boolean.

#t if self is pehmeral, or #f otherwise

Procedure: network-session:new [data-directory] [cache-directory] ⇒ %return

Creates a new <WebKitNetworkSession> with a persistent <WebKitWebsiteDataManager>. The parameters data-directory and cache-directory will be used as construct properties of the <WebKitWebsiteDataManager> of the network session. Note that if #f is passed, the default directory will be passed to <WebKitWebsiteDataManager> so that website-data-manager:get-base-data-directory and website-data-manager:get-base-cache-directory always return a value for non ephemeral sessions.

It must be passed as construct parameter of a <WebKitWebView>.

data-directory

Passed, or left out: a string, or #f.

a base directory for data, or #f

cache-directory

Passed, or left out: a string, or #f.

a base directory for caches, or #f

%return

Returned: a <WebKitNetworkSession>.

the newly created <WebKitNetworkSession>

Procedure: network-session:new-ephemeral ⇒ %return

Creates a new <WebKitNetworkSession> with an ephemeral <WebKitWebsiteDataManager>.

%return

Returned: a <WebKitNetworkSession>.

a new ephemeral <WebKitNetworkSession>.

Method: network-session:prefetch-dns self hostname
Method: prefetch-dns self hostname

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.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

hostname

Passed: a string.

a hostname to be resolved

Method: network-session:set-itp-enabled self enabled
Method: set-itp-enabled self enabled

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 no-third-party is ignored and always is used instead. See also webkit_cookie_session_set_accept_policy().

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

enabled

Passed: a boolean.

value to set

Procedure: network-session:set-memory-pressure-settings settings

Sets settings as the <WebKitMemoryPressureSettings>.

Sets settings as the <WebKitMemoryPressureSettings> to be used by the network process created by any instance of <WebKitNetworkSession> after this function is called.

Be sure to call this function before creating any <WebKitNetworkSession>.

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 #f as the value of settings.

settings

Passed: a <WebKitMemoryPressureSettings>.

a WebKitMemoryPressureSettings.

Method: network-session:set-persistent-credential-storage-enabled self enabled
Method: set-persistent-credential-storage-enabled self enabled

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.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

enabled

Passed: a boolean.

value to set

Method: network-session:set-proxy-settings self proxy-mode [proxy-settings]
Method: set-proxy-settings self proxy-mode [proxy-settings]

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

By default default is used, which means that the system settings will be used (proxy-resolver-get-default). If you want to override the system default settings, you can either use no-proxy to make sure no proxies are used at all, or custom to provide your own proxy settings. When proxy-mode is custom proxy-settings must be a valid <WebKitNetworkProxySettings>; otherwise, proxy-settings must be #f.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

proxy-mode

Passed: a <WebKitNetworkProxyMode>, or one of its symbols.

a <WebKitNetworkProxyMode>

proxy-settings

Passed, or left out: a <WebKitNetworkProxySettings>, or #f.

a <WebKitNetworkProxySettings>, or #f

Method: network-session:set-tls-errors-policy self policy
Method: set-tls-errors-policy self policy

Set the TLS errors policy of self as policy.

self

Passed: a <WebKitNetworkSession>.

a <WebKitNetworkSession>

policy

Passed: a <WebKitTLSErrorsPolicy>, or one of its symbols.

a <WebKitTLSErrorsPolicy>

Signals

Signal: network-session:download-started

Connect a handler with (connect object network-session:download-started handler). It is called as (handler self download).

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

self

Passed: a <WebKitNetworkSession>.

download

Passed: a <WebKitDownload>.

the <WebKitDownload> associated with this event