phoenix_title wx.html2.WebViewConfiguration

This class allows access to web view configuration options and settings, that have to be specified before placing a webview in a window with wx.html2.WebView.Create .

wx.html2.WebView

Added in version 4.3/wxWidgets-3.3.0.

See also

wx.html2.WebView.NewConfiguration


class_hierarchy Class Hierarchy

Inheritance diagram for class WebViewConfiguration:

method_summary Methods Summary

EnablePersistentStorage

Allows to disable persistent storage for the webview.

GetBackend

Returns the backend identifier for which this configuration was created.

GetDataPath

Returns the data path for the webview.

GetNativeConfiguration

Returns the pointer to the native configuration used during creation of a wx.html2.WebView.

SetDataPath

Set the data path for the webview.


property_summary Properties Summary

Backend

See GetBackend

DataPath

See GetDataPath and SetDataPath

NativeConfiguration

See GetNativeConfiguration


api Class API

class wx.html2.WebViewConfiguration(object)

This class allows access to web view configuration options and settings, that have to be specified before placing a webview in a window with WebView.Create().


Methods

EnablePersistentStorage(self, enable)

Allows to disable persistent storage for the webview.

The default is to enable it. When the webview is created without persistent storage the data is stored in memory and is lost when the webview is destroyed. In browsers this is equivalent to “private browsing” or “incognito mode”.

Parameters:

enable (bool)

Return type:

bool

Returns:

True if the backend supports to modify this setting. False if the setting is not supported by the backend.

Added in version 4.3/wxWidgets-3.3.0.

Note

This is only implemented on the Edge, WebKit2GTK+ and macOS backends.



GetBackend(self)

Returns the backend identifier for which this configuration was created.

Return type:

str



GetDataPath(self)

Returns the data path for the webview.

This is the path where the webview stores its data, such as cookies, local storage, etc.

Return type:

str

Returns:

The path to the data directory.

Note

This is used by Edge, WebKit2GTK+ and Chromium backends and always returns empty string for the other ones.



GetNativeConfiguration(self)

Returns the pointer to the native configuration used during creation of a wx.html2.WebView.

When using two-step creation this method can be used to customize configuration options not available via GetNativeBackend() after using Create().

Additional instances of wx.html2.WebView must be created using the same wx.html2.WebViewConfiguration instance.

All settings must be set before creating a new web view with wx.html2.WebView.New .

The return value needs to be down-casted to the appropriate type depending on the backend:

The following pseudo code shows how to use this method with two-step creation to set no user action requirement to play video in a web view:

Return type:

Any



SetDataPath(self, path)

Set the data path for the webview.

This is the path where the webview stores its data, such as cookies, local storage, etc.

Parameters:

path (string) – The path to the data directory.

Return type:

None

Note

This is used by Edge, WebKit2GTK+ and Chromium backends (the latter creates “UserData” subdirectory under the given path).


Properties

Backend

See GetBackend



DataPath

See GetDataPath and SetDataPath



NativeConfiguration

See GetNativeConfiguration