GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • wx.html2.WebViewConfiguration
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx.html2

This view

  • Original page
  • New address

GeezerVison is showing docs.wxpython.org — wx.html2.WebViewConfiguration — wxPython 4.3.2 Docs

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:

Inheritance diagram of WebViewConfiguration


method_summary Methods Summary¶

DisableGPUAcceleration

Disables GPU hardware acceleration for all subsequently created web views.

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¶

static DisableGPUAcceleration()¶

Disables GPU hardware acceleration for all subsequently created web views.

This can be useful when diagnosing rendering issues or when targeting machines with older or unsupported video cards.

This must be called before creating any wx.html2.WebView instance. Once called, GPU acceleration will remain disabled for the lifetime of the application.

Return type:

bool

Returns:

True if the setting was applied successfully, False if it is not supported by the currently used backend.

Added in version 4.3/wxWidgets-3.3.3.

Note

This is currently only implemented for the Edge (MSW) and WebKit2GTK (GTK) backends.



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:

  • 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:

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

© Copyright 2012-2026, The wxPython Team. Created using Sphinx 9.1.0 and the python-docs-theme.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.