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 .
Added in version 4.3/wxWidgets-3.3.0.
See also
wx.html2.WebView.NewConfiguration
Class Hierarchy¶
Inheritance diagram for class WebViewConfiguration:
Methods Summary¶Allows to disable persistent storage for the webview. |
|
Returns the backend identifier for which this configuration was created. |
|
Returns the data path for the webview. |
|
Returns the pointer to the native configuration used during creation of a wx.html2.WebView. |
|
Set the data path for the webview. |
Properties Summary¶See |
|
See |
|
Class API¶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().
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”.
enable (bool)
bool
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.
Returns the backend identifier for which this configuration was created.
str
Returns the data path for the webview.
This is the path where the webview stores its data, such as cookies, local storage, etc.
str
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.
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:
macOS: WKWebViewConfiguration pointer,
Windows with Edge: ICoreWebView2EnvironmentOptions.
WebKitGTK: WebKitWebContext pointer.
With other backends/platforms it’s not implemented.
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:
Any
Set the data path for the webview.
This is the path where the webview stores its data, such as cookies, local storage, etc.
path (string) – The path to the data directory.
None
Note
This is used by Edge, WebKit2GTK+ and Chromium backends (the latter creates “UserData” subdirectory under the given path).
See GetBackend
See GetDataPath and SetDataPath