Settings#

class Settings(**properties: Any)#

Superclasses: Object

Control the behaviour of a WebView.

Settings can be applied to a WebView to control text charset, color, font sizes, printing mode, script support, loading of images and various other things on a WebView. After creation, a Settings object contains default settings.

// Disable JavaScript
WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
webkit_settings_set_enable_javascript (settings, FALSE);

Constructors#

class Settings
classmethod new() Settings#

Creates a new Settings instance with default values.

It must be manually attached to a WebView. See also new_with_settings().

Methods#

class Settings
apply_from_key_file(key_file: KeyFile, group_name: str) bool#

Reads the contents of the given group_name from the given key_file and apply the value of each key/value to the corresponding property on the settings.

Value types have to match with the corresponding setting property type and the group keys have to match existing setting property names. If those conditions are not met, the function will return False.

Supported value types are strings (unquoted), booleans (0, 1, true, false) and unsigned integers.

Added in version 2.46.

Parameters:
  • key_file – a KeyFile

  • group_name – Name of the group to read from key_file

classmethod font_size_to_pixels(points: int) int#

Convert points to the equivalent value in pixels.

Applications can use this function to convert font size values in points to font size values in pixels when setting the font size properties of Settings.

Added in version 2.20.

Parameters:

points – the font size in points to convert to pixels

classmethod font_size_to_points(pixels: int) int#

Convert pixels to the equivalent value in points.

Applications can use this function to convert font size values in pixels to font size values in points when getting the font size properties of Settings.

Added in version 2.20.

Parameters:

pixels – the font size in pixels to convert to points

classmethod get_all_features() FeatureList#

Gets the list of all available WebKit features.

Features can be toggled with set_feature_enabled, and their current state determined with get_feature_enabled.

Note that most applications should use get_development_features and get_experimental_features instead.

Added in version 2.42.

get_allow_file_access_from_file_urls() bool#

Get the Settings:allow-file-access-from-file-urls property.

Added in version 2.10.

get_allow_modal_dialogs() bool#

Get the Settings:allow-modal-dialogs property.

get_allow_top_navigation_to_data_urls() bool#

Get the Settings:allow-top-navigation-to-data-urls property.

Added in version 2.28.

get_allow_universal_access_from_file_urls() bool#

Get the Settings:allow-universal-access-from-file-urls property.

Added in version 2.14.

get_auto_load_images() bool#

Get the Settings:auto-load-images property.

get_cursive_font_family() str#

Gets the Settings:cursive-font-family property.

get_default_charset() str#

Gets the Settings:default-charset property.

get_default_font_family() str#

Gets the Settings:default-font-family property.

get_default_font_size() int#

Gets the Settings:default-font-size property.

get_default_monospace_font_size() int#

Gets the Settings:default-monospace-font-size property.

classmethod get_development_features() FeatureList#

Gets the list of available development WebKit features.

The returned features are a subset of those returned by get_all_features, and includes those which web and WebKit developers might find useful, but in general should not be exposed to end users; see FeatureStatus for more details.

Added in version 2.42.

get_disable_web_security() bool#

Get the Settings:disable-web-security property.

Added in version 2.40.

get_draw_compositing_indicators() bool#

Get the Settings:draw-compositing-indicators property.

get_enable_2d_canvas_acceleration() bool#

Get the Settings:enable-2d-canvas-acceleration property.

Added in version 2.46.

get_enable_back_forward_navigation_gestures() bool#

Get the Settings:enable-back-forward-navigation-gestures property.

Added in version 2.24.

get_enable_caret_browsing() bool#

Get the Settings:enable-caret-browsing property.

get_enable_developer_extras() bool#

Get the Settings:enable-developer-extras property.

get_enable_dns_prefetching() bool#

Get the Settings:enable-dns-prefetching property.

Deprecated since version 2.48.: Please do not use it in newly written code

get_enable_encrypted_media() bool#

Get the Settings:enable-encrypted-media property.

Added in version 2.20.

get_enable_fullscreen() bool#

Get the Settings:enable-fullscreen property.

get_enable_html5_database() bool#

Get the Settings:enable-html5-database property.

get_enable_html5_local_storage() bool#

Get the Settings:enable-html5-local-storage property.

Get the Settings:enable-hyperlink-auditing property.

Deprecated since version 2.50.: Please do not use it in newly written code

get_enable_javascript() bool#

Get the Settings:enable-javascript property.

get_enable_javascript_markup() bool#

Get the Settings:enable-javascript-markup property.

Added in version 2.24.

get_enable_media() bool#

Get the Settings:enable-media property.

Added in version 2.26.

get_enable_media_capabilities() bool#

Get the Settings:enable-media-capabilities property.

Added in version 2.22.

get_enable_media_stream() bool#

Get the Settings:enable-media-stream property.

Added in version 2.4.

get_enable_mediasource() bool#

Get the Settings:enable-mediasource property.

Added in version 2.4.

get_enable_mock_capture_devices() bool#

Get the Settings:enable-mock-capture-devices property.

Added in version 2.24.

get_enable_offline_web_application_cache() bool#

Get the Settings:enable-offline-web-application-cache property.

Deprecated since version 2.44: Please do not use it in newly written code

get_enable_page_cache() bool#

Get the Settings:enable-page-cache property.

get_enable_resizable_text_areas() bool#

Get the Settings:enable-resizable-text-areas property.

get_enable_site_specific_quirks() bool#

Get the Settings:enable-site-specific-quirks property.

get_enable_smooth_scrolling() bool#

Get the Settings:enable-smooth-scrolling property.

get_enable_spatial_navigation() bool#

Get the Settings:enable-spatial-navigation property.

Added in version 2.2.

Get the Settings:enable-tabs-to-links property.

get_enable_webaudio() bool#

Get the Settings:enable-webaudio property.

get_enable_webgl() bool#

Get the Settings:enable-webgl property.

get_enable_webrtc() bool#

Get the enable_webrtc property.

Added in version 2.38.

get_enable_write_console_messages_to_stdout() bool#

Get the Settings:enable-write-console-messages-to-stdout property.

Added in version 2.2.

classmethod get_experimental_features() FeatureList#

Gets the list of available experimental WebKit features.

The returned features are a subset of those returned by get_all_features, and includes those which certain applications may want to expose to end users; see FeatureStatus for more details.

Added in version 2.42.

get_fantasy_font_family() str#

Gets the Settings:fantasy-font-family property.

get_feature_enabled(feature: Feature) bool#

Gets whether a feature is enabled.

Added in version 2.42.

Parameters:

feature – the feature to toggle.

get_hardware_acceleration_policy() HardwareAccelerationPolicy#

Get the Settings:hardware-acceleration-policy property.

Added in version 2.16.

get_javascript_can_access_clipboard() bool#

Get the Settings:javascript-can-access-clipboard property.

get_javascript_can_open_windows_automatically() bool#

Get the Settings:javascript-can-open-windows-automatically property.

get_load_icons_ignoring_image_load_setting() bool#

Setting no longer supported. This function returns False.

Deprecated since version 2.42: Please do not use it in newly written code

get_math_font_family() str | None#

Gets the Settings:math-font-family property.

get_media_content_types_requiring_hardware_support() str#

Gets the Settings:media-content-types-requiring-hardware-support property.

Added in version 2.30.

get_media_playback_allows_inline() bool#

Get the Settings:media-playback-allows-inline property.

get_media_playback_requires_user_gesture() bool#

Get the Settings:media-playback-requires-user-gesture property.

get_minimum_font_size() int#

Gets the Settings:minimum-font-size property.

get_monospace_font_family() str#

Gets the Settings:monospace-font-family property.

get_pictograph_font_family() str#

Gets the Settings:pictograph-font-family property.

get_print_backgrounds() bool#

Get the Settings:print-backgrounds property.

get_sans_serif_font_family() str#

Gets the Settings:sans-serif-font-family property.

get_serif_font_family() str#

Gets the Settings:serif-font-family property.

get_user_agent() str#

Get the Settings:user-agent property.

get_webrtc_udp_ports_range() str#

Get the webrtc_udp_ports_range property.

Added in version 2.48.

get_zoom_text_only() bool#

Get the Settings:zoom-text-only property.

set_allow_file_access_from_file_urls(allowed: bool) None#

Set the Settings:allow-file-access-from-file-urls property.

Added in version 2.10.

Parameters:

allowed – Value to be set

set_allow_modal_dialogs(allowed: bool) None#

Set the Settings:allow-modal-dialogs property.

Parameters:

allowed – Value to be set

set_allow_top_navigation_to_data_urls(allowed: bool) None#

Set the Settings:allow-top-navigation-to-data-urls property.

Added in version 2.28.

Parameters:

allowed – Value to be set

set_allow_universal_access_from_file_urls(allowed: bool) None#

Set the Settings:allow-universal-access-from-file-urls property.

Added in version 2.14.

Parameters:

allowed – Value to be set

set_auto_load_images(enabled: bool) None#

Set the Settings:auto-load-images property.

Parameters:

enabled – Value to be set

set_cursive_font_family(cursive_font_family: str) None#

Set the Settings:cursive-font-family property.

Parameters:

cursive_font_family – the new default cursive font family

set_default_charset(default_charset: str) None#

Set the Settings:default-charset property.

Parameters:

default_charset – default charset to be set

set_default_font_family(default_font_family: str) None#

Set the Settings:default-font-family property.

Parameters:

default_font_family – the new default font family

set_default_font_size(font_size: int) None#

Set the Settings:default-font-size property.

Parameters:

font_size – default font size to be set in pixels

set_default_monospace_font_size(font_size: int) None#

Set the Settings:default-monospace-font-size property.

Parameters:

font_size – default monospace font size to be set in pixels

set_disable_web_security(disabled: bool) None#

Set the Settings:disable-web-security property.

Added in version 2.40.

Parameters:

disabled – Value to be set

set_draw_compositing_indicators(enabled: bool) None#

Set the Settings:draw-compositing-indicators property.

Parameters:

enabled – Value to be set

set_enable_2d_canvas_acceleration(enabled: bool) None#

Set the Settings:enable-2d-canvas-acceleration property.

Added in version 2.46.

Parameters:

enabled – Value to be set

set_enable_back_forward_navigation_gestures(enabled: bool) None#

Set the Settings:enable-back-forward-navigation-gestures property.

Added in version 2.24.

Parameters:

enabled – value to be set

set_enable_caret_browsing(enabled: bool) None#

Set the Settings:enable-caret-browsing property.

Parameters:

enabled – Value to be set

set_enable_developer_extras(enabled: bool) None#

Set the Settings:enable-developer-extras property.

Parameters:

enabled – Value to be set

set_enable_dns_prefetching(enabled: bool) None#

Set the Settings:enable-dns-prefetching property.

Deprecated since version 2.48.: Please do not use it in newly written code

Parameters:

enabled – Value to be set

set_enable_encrypted_media(enabled: bool) None#

Set the Settings:enable-encrypted-media property.

Added in version 2.20.

Parameters:

enabled – Value to be set

set_enable_fullscreen(enabled: bool) None#

Set the Settings:enable-fullscreen property.

Parameters:

enabled – Value to be set

set_enable_html5_database(enabled: bool) None#

Set the Settings:enable-html5-database property.

Parameters:

enabled – Value to be set

set_enable_html5_local_storage(enabled: bool) None#

Set the Settings:enable-html5-local-storage property.

Parameters:

enabled – Value to be set

Set the Settings:enable-hyperlink-auditing property.

Deprecated since version 2.50.: Please do not use it in newly written code

Parameters:

enabled – Value to be set

set_enable_javascript(enabled: bool) None#

Set the Settings:enable-javascript property.

Parameters:

enabled – Value to be set

set_enable_javascript_markup(enabled: bool) None#

Set the Settings:enable-javascript-markup property.

Added in version 2.24.

Parameters:

enabled – Value to be set

set_enable_media(enabled: bool) None#

Set the Settings:enable-media property.

Added in version 2.26.

Parameters:

enabled – Value to be set

set_enable_media_capabilities(enabled: bool) None#

Set the Settings:enable-media-capabilities property.

Added in version 2.22.

Parameters:

enabled – Value to be set

set_enable_media_stream(enabled: bool) None#

Set the Settings:enable-media-stream property.

Added in version 2.4.

Parameters:

enabled – Value to be set

set_enable_mediasource(enabled: bool) None#

Set the Settings:enable-mediasource property.

Added in version 2.4.

Parameters:

enabled – Value to be set

set_enable_mock_capture_devices(enabled: bool) None#

Set the Settings:enable-mock-capture-devices property.

Added in version 2.4.

Parameters:

enabled – Value to be set

set_enable_offline_web_application_cache(enabled: bool) None#

Setting no longer supported. This function does nothing.

Deprecated since version 2.44: Please do not use it in newly written code

Parameters:

enabled – Value to be set

set_enable_page_cache(enabled: bool) None#

Set the Settings:enable-page-cache property.

Parameters:

enabled – Value to be set

set_enable_resizable_text_areas(enabled: bool) None#

Set the Settings:enable-resizable-text-areas property.

Parameters:

enabled – Value to be set

set_enable_site_specific_quirks(enabled: bool) None#

Set the Settings:enable-site-specific-quirks property.

Parameters:

enabled – Value to be set

set_enable_smooth_scrolling(enabled: bool) None#

Set the Settings:enable-smooth-scrolling property.

Parameters:

enabled – Value to be set

set_enable_spatial_navigation(enabled: bool) None#

Set the Settings:enable-spatial-navigation property.

Added in version 2.2.

Parameters:

enabled – Value to be set

Set the Settings:enable-tabs-to-links property.

Parameters:

enabled – Value to be set

set_enable_webaudio(enabled: bool) None#

Set the Settings:enable-webaudio property.

Parameters:

enabled – Value to be set

set_enable_webgl(enabled: bool) None#

Set the Settings:enable-webgl property.

Parameters:

enabled – Value to be set

set_enable_webrtc(enabled: bool) None#

Set the enable_webrtc property.

Setting this property to True implies the media-stream web-setting will also be enabled.

Added in version 2.38.

Parameters:

enabled – Value to be set

set_enable_write_console_messages_to_stdout(enabled: bool) None#

Set the Settings:enable-write-console-messages-to-stdout property.

Added in version 2.2.

Parameters:

enabled – Value to be set

set_fantasy_font_family(fantasy_font_family: str) None#

Set the Settings:fantasy-font-family property.

Parameters:

fantasy_font_family – the new default fantasy font family

set_feature_enabled(feature: Feature, enabled: bool) None#

Enables or disables a feature.

The current status of the feature can be determined with webkit_settings_get_feature_enabled. To reset a feature to its initial status, pass the value returned by webkit_feature_get_default_value as the enabled parameter.

Added in version 2.42.

Parameters:
  • feature – the feature to toggle.

  • enabled – whether the feature will be enabled.

set_hardware_acceleration_policy(policy: HardwareAccelerationPolicy) None#

Set the Settings:hardware-acceleration-policy property.

Added in version 2.16.

Parameters:

policy – a HardwareAccelerationPolicy

set_javascript_can_access_clipboard(enabled: bool) None#

Set the Settings:javascript-can-access-clipboard property.

Parameters:

enabled – Value to be set

set_javascript_can_open_windows_automatically(enabled: bool) None#

Set the Settings:javascript-can-open-windows-automatically property.

Parameters:

enabled – Value to be set

set_load_icons_ignoring_image_load_setting(enabled: bool) None#

Setting no longer supported. This function does nothing.

Deprecated since version 2.42: Please do not use it in newly written code

Parameters:

enabled – Value to be set

set_math_font_family(math_font_family: str | None = None) None#

Set the Settings:math-font-family property.

Since 2.52

Parameters:

math_font_family – the new default math font family

set_media_content_types_requiring_hardware_support(content_types: str | None = None) None#

Set the Settings:media-content-types-requiring-hardware-support property.

Added in version 2.30.

Parameters:

content_types – list of media content types requiring hardware support split by semicolons (:) or None to use the default value.

set_media_playback_allows_inline(enabled: bool) None#

Set the Settings:media-playback-allows-inline property.

Parameters:

enabled – Value to be set

set_media_playback_requires_user_gesture(enabled: bool) None#

Set the Settings:media-playback-requires-user-gesture property.

Parameters:

enabled – Value to be set

set_minimum_font_size(font_size: int) None#

Set the Settings:minimum-font-size property.

Parameters:

font_size – minimum font size to be set in pixels

set_monospace_font_family(monospace_font_family: str) None#

Set the Settings:monospace-font-family property.

Parameters:

monospace_font_family – the new default monospace font family

set_pictograph_font_family(pictograph_font_family: str) None#

Set the Settings:pictograph-font-family property.

Parameters:

pictograph_font_family – the new default pictograph font family

set_print_backgrounds(print_backgrounds: bool) None#

Set the Settings:print-backgrounds property.

Parameters:

print_backgrounds – Value to be set

set_sans_serif_font_family(sans_serif_font_family: str) None#

Set the Settings:sans-serif-font-family property.

Parameters:

sans_serif_font_family – the new default sans-serif font family

set_serif_font_family(serif_font_family: str) None#

Set the Settings:serif-font-family property.

Parameters:

serif_font_family – the new default serif font family

set_user_agent(user_agent: str | None = None) None#

Set the Settings:user-agent property.

Parameters:

user_agent – The new custom user agent string or None to use the default user agent

set_user_agent_with_application_details(application_name: str | None = None, application_version: str | None = None) None#

Set the Settings:user-agent property by appending the application details.

Set the Settings:user-agent property by appending the application details to the default user agent. If no application name or version is given, the default user agent used will be used. If only the version is given, the default engine version is used with the given application name.

Parameters:
  • application_name – The application name used for the user agent or None to use the default user agent.

  • application_version – The application version for the user agent or None to user the default version.

set_webrtc_udp_ports_range(udp_port_range: str) None#

Set the webrtc_udp_ports_range property.

Added in version 2.48.

Parameters:

udp_port_range – Value to be set

set_zoom_text_only(zoom_text_only: bool) None#

Set the Settings:zoom-text-only property.

Parameters:

zoom_text_only – Value to be set

Properties#

class Settings
props.allow_file_access_from_file_urls: bool#

Whether file access is allowed from file URLs. By default, when something is loaded in a WebView using a file URI, cross origin requests to other file resources are not allowed. This setting allows you to change that behaviour, so that it would be possible to do a XMLHttpRequest of a local file, for example.

Added in version 2.10.

props.allow_modal_dialogs: bool#

Determine whether it’s allowed to create and run modal dialogs from a WebView through JavaScript with <function>window.showModalDialog</function>. If it’s set to False, the associated WebView won’t be able to create new modal dialogs, so not even the WebView::create signal will be emitted.

props.allow_top_navigation_to_data_urls: bool#

Whether or not the top frame is allowed to navigate to data URLs. It is disabled by default due to the risk it poses when loading untrusted URLs, with data URLs being used in scamming and phishing attacks. In contrast, a scenario where it could be enabled could be an app that embeds a WebView and you have control of the pages being show instead of a generic browser.

Added in version 2.28.

props.allow_universal_access_from_file_urls: bool#

Whether or not JavaScript running in the context of a file scheme URL should be allowed to access content from any origin. By default, when something is loaded in a WebView using a file scheme URL, access to the local file system and arbitrary local storage is not allowed. This setting allows you to change that behaviour, so that it would be possible to use local storage, for example.

Added in version 2.14.

props.auto_load_images: bool#

Determines whether images should be automatically loaded or not. On devices where network bandwidth is of concern, it might be useful to turn this property off.

props.cursive_font_family: str#

The font family used as the default for content using a cursive font.

props.default_charset: str#

The default text charset used when interpreting content with an unspecified charset.

props.default_font_family: str#

The font family to use as the default for content that does not specify a font.

props.default_font_size: int#

The default font size in pixels to use for content displayed if no font size is specified.

props.default_monospace_font_size: int#

The default font size in pixels to use for content displayed in monospace font if no font size is specified.

props.disable_web_security: bool#

Enable or disable support for Web Security on pages.

This setting disables the same-origin policy, allowing every website full control over all other websites. This is for use in special environments where you wish to disable all security and allow websites to hack each other. It is impossible to use this setting securely.

Added in version 2.40.

props.draw_compositing_indicators: bool#

Whether to draw compositing borders and repaint counters on layers drawn with accelerated compositing. This is useful for debugging issues related to web content that is composited with the GPU.

props.enable_2d_canvas_acceleration: bool#

Enable or disable 2D canvas acceleration. If this setting is enabled, the 2D canvas will be accelerated even if Skia CPU is used for rendering. However, the canvas can be unaccelerated even when this setting is enabled, for other reasons like its size or when willReadFrequently property is used.

Added in version 2.46.

props.enable_back_forward_navigation_gestures: bool#

Enable or disable horizontal swipe gesture for back-forward navigation.

Added in version 2.24.

props.enable_caret_browsing: bool#

Whether to enable accessibility enhanced keyboard navigation.

props.enable_developer_extras: bool#

Determines whether or not developer tools, such as the Web Inspector, are enabled.

props.enable_dns_prefetching: bool#

Determines whether or not to prefetch domain names. DNS prefetching attempts to resolve domain names before a user tries to follow a link.

Deprecated since version 2.48: Please do not use it in newly written code

props.enable_encrypted_media: bool#

Enable or disable support for Encrypted Media API on pages. EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML. This property will only work as intended if the EncryptedMedia feature is enabled at build time with the ENABLE_ENCRYPTED_MEDIA flag.

See https://www.w3.org/TR/encrypted-media/

Added in version 2.20.

props.enable_fullscreen: bool#

Whether to enable the Javascript Fullscreen API. The API allows any HTML element to request fullscreen display. See also the current draft of the spec: http://www.w3.org/TR/fullscreen/

props.enable_html5_database: bool#

Whether to enable HTML5 client-side SQL database support (IndexedDB).

props.enable_html5_local_storage: bool#

Whether to enable HTML5 local storage support. Local storage provides simple synchronous storage access.

HTML5 local storage specification is available at http://dev.w3.org/html5/webstorage/.

Determines whether or not hyperlink auditing is enabled.

The hyperlink auditing specification is available at http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html``hyperlink``-auditing.

Deprecated since version 2.50: Please do not use it in newly written code

props.enable_javascript: bool#

Determines whether or not JavaScript executes within a page.

props.enable_javascript_markup: bool#

Determines whether or not JavaScript markup is allowed in document. When this setting is disabled, all JavaScript-related elements and attributes are removed from the document during parsing. Note that executing JavaScript is still allowed if Settings:enable-javascript is True.

Added in version 2.24.

props.enable_media: bool#

Enable or disable support for media playback on pages. This setting is enabled by default. Disabling it means <audio>, <track> and <video> elements will have playback support disabled.

Added in version 2.26.

props.enable_media_capabilities: bool#

Enable or disable support for MediaCapabilities on pages. This specification intends to provide APIs to allow websites to make an optimal decision when picking media content for the user. The APIs will expose information about the decoding and encoding capabilities for a given format but also output capabilities to find the best match based on the device’s display.

See also https://wicg.github.io/media-capabilities/

Added in version 2.22.

props.enable_media_stream: bool#

Enable or disable support for MediaStream on pages. MediaStream is an experimental proposal for allowing web pages to access audio and video devices for capture.

See also http://dev.w3.org/2011/webrtc/editor/getusermedia.html

Added in version 2.4.

props.enable_mediasource: bool#

Enable or disable support for MediaSource on pages. MediaSource extends HTMLMediaElement to allow JavaScript to generate media streams for playback.

See also http://www.w3.org/TR/media-source/

Added in version 2.4.

props.enable_mock_capture_devices: bool#

Enable or disable the Mock Capture Devices. Those are fake Microphone and Camera devices to be used as MediaStream sources.

Added in version 2.24.

props.enable_offline_web_application_cache: bool#

Unsupported setting. This property does nothing.

Deprecated since version 2.44: Please do not use it in newly written code

props.enable_page_cache: bool#

Enable or disable the page cache. Disabling the page cache is generally only useful for special circumstances like low-memory scenarios or special purpose applications like static HTML viewers. This setting only controls the Page Cache, this cache is different than the disk-based or memory-based traditional resource caches, its point is to make going back and forth between pages much faster. For details about the different types of caches and their purposes see: http://webkit.org/blog/427/webkit-page-cache-i-the-basics/

props.enable_resizable_text_areas: bool#

Determines whether or not text areas can be resized.

props.enable_site_specific_quirks: bool#

Whether to turn on site-specific quirks. Turning this on will tell WebKit to use some site-specific workarounds for better web compatibility. For example, older versions of MediaWiki will incorrectly send to WebKit a CSS file with KHTML workarounds. By turning on site-specific quirks, WebKit will special-case this and other cases to make some specific sites work.

props.enable_smooth_scrolling: bool#

Enable or disable smooth scrolling.

props.enable_spatial_navigation: bool#

Whether to enable Spatial Navigation. This feature consists in the ability to navigate between focusable elements in a Web page, such as hyperlinks and form controls, by using Left, Right, Up and Down arrow keys. For example, if an user presses the Right key, heuristics determine whether there is an element they might be trying to reach towards the right, and if there are multiple elements, which element they probably wants.

Added in version 2.4.

Determines whether the tab key cycles through the elements on the page. When this setting is enabled, users will be able to focus the next element in the page by pressing the tab key. If the selected element is editable, then pressing tab key will insert the tab character.

props.enable_webaudio: bool#

Enable or disable support for WebAudio on pages. WebAudio is an API for processing and synthesizing audio in web applications

See also https://webaudio.github.io/web-audio-api

props.enable_webgl: bool#

Enable or disable support for WebGL on pages. WebGL enables web content to use an API based on OpenGL ES 2.0.

props.enable_webrtc: bool#

Enable WebRTC support for loaded pages.

Enabling this setting implies that enable_media_stream will be enabled as well.

See also https://www.w3.org/TR/webrtc/

Added in version 2.38.

props.enable_write_console_messages_to_stdout: bool#

Enable or disable writing console messages to stdout. These are messages sent to the console with console.log and related methods.

Added in version 2.2.

props.fantasy_font_family: str#

The font family used as the default for content using a fantasy font.

props.hardware_acceleration_policy: HardwareAccelerationPolicy#

The HardwareAccelerationPolicy to decide how to enable and disable hardware acceleration. Disabling hardware acceleration might cause some websites to not render correctly or consume more CPU.

Note that changing this setting might not be possible if hardware acceleration is not supported by the hardware or the system. In that case, you can get the value to know the actual policy being used, but changing the setting will not have any effect.

Added in version 2.16.

props.javascript_can_access_clipboard: bool#

Whether JavaScript can access the clipboard. The default value is False. If set to True, document.execCommand() allows cut, copy and paste commands.

props.javascript_can_open_windows_automatically: bool#

Whether JavaScript can open popup windows automatically without user intervention.

props.load_icons_ignoring_image_load_setting: bool#

Unsupported setting. This property does nothing.

Deprecated since version 2.42: Please do not use it in newly written code

props.math_font_family: str#

The font family used as the default for content using a math font.

Added in version 2.52.

props.media_content_types_requiring_hardware_support: str#

List of media content types requiring hardware support, split by semicolons (:). For example: ‘video/webm; codecs=”vp*”:video/mp4; codecs=”avc*":video/wzxhzdk:0 codecs=”av1*”’.

Added in version 2.30.

props.media_playback_allows_inline: bool#

Whether media playback is full-screen only or inline playback is allowed. This is True by default, so media playback can be inline. Setting it to False allows specifying that media playback should be always fullscreen.

props.media_playback_requires_user_gesture: bool#

Whether a user gesture (such as clicking the play button) would be required to start media playback or load media. This is off by default, so media playback could start automatically. Setting it on requires a gesture by the user to start playback, or to load the media.

props.minimum_font_size: int#

The minimum font size in pixels used to display text. This setting controls the absolute smallest size. Values other than 0 can potentially break page layouts.

props.monospace_font_family: str#

The font family used as the default for content using a monospace font.

props.pictograph_font_family: str#

The font family used as the default for content using a pictograph font.

props.print_backgrounds: bool#

Whether background images should be drawn during printing.

props.sans_serif_font_family: str#

The font family used as the default for content using a sans-serif font.

props.serif_font_family: str#

The font family used as the default for content using a serif font.

props.user_agent: str#

The user-agent string used by WebKit. Unusual user-agent strings may cause web content to render incorrectly or fail to run, as many web pages are written to parse the user-agent strings of only the most popular browsers. Therefore, it’s typically better to not completely override the standard user-agent, but to use set_user_agent_with_application_details() instead.

If this property is set to the empty string or None, it will revert to the standard user-agent.

props.webrtc_udp_ports_range: str#

Allow customization of the WebRTC UDP ports range.

In some constrained environments where a firewall blocks UDP network traffic excepted on a specific port range, this settings can be used to give hints to the WebRTC backend regarding which ports to allocate. The format is min-port:max-port, so for instance 20000:30000. The default empty string value means the OS will use no hints from the WebRTC backend. Using 0 for one of the values is allowed and means the value is unspecified.

Added in version 2.48.

props.zoom_text_only: bool#

Whether WebView:zoom-level affects only the text of the page or all the contents. Other contents containing text like form controls will be also affected by zoom factor when this property is enabled.