WebKit.Settings¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/c |
Whether file access is allowed from file URLs. |
||
r/w/c |
Whether it is possible to create modal dialogs |
||
r/w/c |
Whether or not top frame navigation is allowed to data URLs |
||
r/w/c |
Whether or not universal access is allowed from the context of file scheme URLs |
||
r/w/c |
Load images automatically. |
||
r/w/c |
The font family used as the default for content using cursive font. |
||
r/w/c |
The default text charset used when interpreting content with unspecified charset. |
||
r/w/c |
The font family to use as the default for content that does not specify a font. |
||
r/w/c |
The default font size used to display text. |
||
r/w/c |
The default font size used to display monospace text. |
||
r/w/c |
Whether web security should be disabled. |
||
r/w/c |
Whether to draw compositing borders and repaint counters |
||
r/w/c |
Whether to enable 2D canvas acceleration |
||
r/w/c |
Whether horizontal swipe gesture will trigger back-forward navigation |
||
r/w/c |
Whether to enable accessibility enhanced keyboard navigation |
||
r/w/c |
Whether to enable developer extras |
||
d/r/w/c |
Whether to enable DNS prefetching |
||
r/w/c |
Whether EncryptedMedia should be enabled. |
||
r/w/c |
Whether to enable the Javascript Fullscreen API |
||
r/w/c |
Whether to enable HTML5 database support. |
||
r/w/c |
Whether to enable HTML5 Local Storage support. |
||
r/w/c |
Whether <a ping> should be able to send pings. |
||
r/w/c |
Enable JavaScript. |
||
r/w/c |
Enable JavaScript in document markup. |
||
r/w/c |
Whether media content should be handled |
||
r/w/c |
Whether MediaCapabilities should be enabled. |
||
r/w/c |
Whether MediaStream content should be handled |
||
r/w/c |
Whether MediaSource should be enabled. |
||
r/w/c |
Whether we expose mock capture devices or not |
||
d/r/w/c |
Whether to enable offline web application cache. |
||
r/w/c |
Whether the page cache should be used |
||
r/w/c |
Whether to enable resizable text areas |
||
r/w/c |
Enables the site-specific compatibility workarounds |
||
r/w/c |
Whether to enable smooth scrolling |
||
r/w/c |
Whether to enable Spatial Navigation support. |
||
r/w/c |
Whether to enable tabs to links |
||
r/w/c |
Whether WebAudio content should be handled |
||
r/w/c |
Whether WebGL content should be rendered |
||
r/w/c |
Whether WebRTC content should be handled |
||
r/w/c |
Whether to write console messages on stdout |
||
r/w/c |
The font family used as the default for content using fantasy font. |
||
r/w/c |
The policy to decide how to enable and disable hardware acceleration |
||
r/w/c |
Whether JavaScript can access Clipboard |
||
r/w/c |
Whether JavaScript can open windows automatically. |
||
d/r/w/c |
Whether to load site icons ignoring image load setting. |
||
r/w/c |
List of media content types requiring hardware support. |
||
r/w/c |
Whether media playback allows inline |
||
r/w/c |
Whether media playback requires user gesture |
||
r/w/c |
The minimum font size used to display text. |
||
r/w/c |
The font family used as the default for content using monospace font. |
||
r/w/c |
The font family used as the default for content using pictograph font. |
||
r/w/c |
Whether background images should be drawn during printing |
||
r/w/c |
The font family used as the default for content using sans-serif font. |
||
r/w/c |
The font family used as the default for content using serif font. |
||
r/w/c |
The user agent string |
||
r/w/c |
WebRTC UDP ports range, the format is min-port:max-port |
||
r/w/c |
Whether zoom level of web view changes only the text size |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class WebKit.Settings(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Control the behaviour of a
WebKit.WebView.WebKit.Settingscan be applied to aWebKit.WebViewto control text charset, color, font sizes, printing mode, script support, loading of images and various other things on aWebKit.WebView. After creation, aWebKit.Settingsobject contains default settings.``c // Disable JavaScript WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group); webkit_settings_set_enable_javascript (settings, FALSE); ``
- classmethod font_size_to_pixels(points)¶
- Parameters:
points (
int) – the font size in points to convert to pixels- Returns:
the equivalent font size in pixels.
- Return type:
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
WebKit.Settings.New in version 2.20.
- classmethod font_size_to_points(pixels)¶
- Parameters:
pixels (
int) – the font size in pixels to convert to points- Returns:
the equivalent font size in points.
- Return type:
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
WebKit.Settings.New in version 2.20.
- classmethod get_all_features()¶
- Returns:
List of all features.
- Return type:
Gets the list of all available WebKit features.
Features can be toggled with [method`Settings`.set_feature_enabled], and their current state determined with [method`Settings`.get_feature_enabled].
Note that most applications should use [func`Settings`.get_development_features] and [func`Settings`.get_experimental_features] instead.
New in version 2.42.
- classmethod get_development_features()¶
- Returns:
List of development features.
- Return type:
Gets the list of available development WebKit features.
The returned features are a subset of those returned by [func`Settings`.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 [enum`FeatureStatus`] for more details.
New in version 2.42.
- classmethod get_experimental_features()¶
- Returns:
List of experimental features.
- Return type:
Gets the list of available experimental WebKit features.
The returned features are a subset of those returned by [func`Settings`.get_all_features], and includes those which certain applications may want to expose to end users; see [enum`FeatureStatus`] for more details.
New in version 2.42.
- classmethod new()¶
- Returns:
a new
WebKit.Settingsinstance.- Return type:
Creates a new
WebKit.Settingsinstance with default values.It must be manually attached to a
WebKit.WebView. See also webkit_settings_new_with_settings().
- apply_from_key_file(key_file, group_name)¶
- Parameters:
key_file (
GLib.KeyFile) – aGLib.KeyFilegroup_name (
str) – Name of the group to read from key_file
- Raises:
- Returns:
Trueif the settings were correctly applied orFalseon error.- Return type:
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 self.
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.
New in version 2.46.
- get_allow_file_access_from_file_urls()¶
-
Get the
WebKit.Settings:allow-file-access-from-file-urlsproperty.New in version 2.10.
- get_allow_modal_dialogs()¶
-
Get the
WebKit.Settings:allow-modal-dialogsproperty.
- Returns:
TrueIf navigation to data URLs from the top frame is allowed orFalse\ otherwise.- Return type:
Get the
WebKit.Settings:allow-top-navigation-to-data-urlsproperty.New in version 2.28.
- get_allow_universal_access_from_file_urls()¶
-
Get the
WebKit.Settings:allow-universal-access-from-file-urlsproperty.New in version 2.14.
- get_auto_load_images()¶
-
Get the
WebKit.Settings:auto-load-imagesproperty.
- get_cursive_font_family()¶
- Returns:
The default font family used to display content marked with cursive font.
- Return type:
Gets the
WebKit.Settings:cursive-font-familyproperty.
- get_default_charset()¶
- Returns:
Default charset.
- Return type:
Gets the
WebKit.Settings:default-charsetproperty.
- get_default_font_family()¶
- Returns:
The default font family used to display content that does not specify a font.
- Return type:
Gets the
WebKit.Settings:default-font-familyproperty.
- get_default_font_size()¶
- Returns:
The default font size, in pixels.
- Return type:
Gets the
WebKit.Settings:default-font-sizeproperty.
- get_default_monospace_font_size()¶
- Returns:
Default monospace font size, in pixels.
- Return type:
Gets the
WebKit.Settings:default-monospace-font-sizeproperty.
- get_disable_web_security()¶
-
Get the
WebKit.Settings:disable-web-securityproperty.New in version 2.40.
- get_draw_compositing_indicators()¶
-
Get the
WebKit.Settings:draw-compositing-indicatorsproperty.
- get_enable_2d_canvas_acceleration()¶
-
Get the
WebKit.Settings:enable-2d-canvas-accelerationproperty.New in version 2.46.
- Returns:
Trueif horizontal swipe gesture will trigger back-forward navigaiton orFalseotherwise.- Return type:
Get the
WebKit.Settings:enable-back-forward-navigation-gesturesproperty.New in version 2.24.
- get_enable_caret_browsing()¶
-
Get the
WebKit.Settings:enable-caret-browsingproperty.
- get_enable_developer_extras()¶
-
Get the
WebKit.Settings:enable-developer-extrasproperty.
- get_enable_dns_prefetching()¶
-
Get the
WebKit.Settings:enable-dns-prefetchingproperty.Deprecated since version 2.48..
- get_enable_encrypted_media()¶
-
Get the
WebKit.Settings:enable-encrypted-mediaproperty.New in version 2.20.
- get_enable_fullscreen()¶
-
Get the
WebKit.Settings:enable-fullscreenproperty.
- get_enable_html5_database()¶
-
Get the
WebKit.Settings:enable-html5-databaseproperty.
- get_enable_html5_local_storage()¶
-
Get the
WebKit.Settings:enable-html5-local-storageproperty.
- get_enable_hyperlink_auditing()¶
-
Get the
WebKit.Settings:enable-hyperlink-auditingproperty.
- get_enable_javascript()¶
-
Get the
WebKit.Settings:enable-javascriptproperty.
- get_enable_javascript_markup()¶
-
Get the
WebKit.Settings:enable-javascript-markupproperty.New in version 2.24.
- get_enable_media()¶
-
Get the
WebKit.Settings:enable-mediaproperty.New in version 2.26.
- get_enable_media_capabilities()¶
-
Get the
WebKit.Settings:enable-media-capabilitiesproperty.New in version 2.22.
- get_enable_media_stream()¶
-
Get the
WebKit.Settings:enable-media-streamproperty.New in version 2.4.
- get_enable_mediasource()¶
-
Get the
WebKit.Settings:enable-mediasourceproperty.New in version 2.4.
- get_enable_mock_capture_devices()¶
-
Get the
WebKit.Settings:enable-mock-capture-devicesproperty.New in version 2.24.
- get_enable_offline_web_application_cache()¶
-
Get the
WebKit.Settings:enable-offline-web-application-cacheproperty.Deprecated since version 2.44.
- get_enable_page_cache()¶
-
Get the
WebKit.Settings:enable-page-cacheproperty.
- get_enable_resizable_text_areas()¶
-
Get the
WebKit.Settings:enable-resizable-text-areasproperty.
- get_enable_site_specific_quirks()¶
-
Get the
WebKit.Settings:enable-site-specific-quirksproperty.
- get_enable_smooth_scrolling()¶
-
Get the
WebKit.Settings:enable-smooth-scrollingproperty.
-
Get the
WebKit.Settings:enable-spatial-navigationproperty.New in version 2.2.
- get_enable_tabs_to_links()¶
-
Get the
WebKit.Settings:enable-tabs-to-linksproperty.
- get_enable_webaudio()¶
-
Get the
WebKit.Settings:enable-webaudioproperty.
- get_enable_webgl()¶
-
Get the
WebKit.Settings:enable-webglproperty.
- get_enable_webrtc()¶
-
Get the [property`Settings`:py:data::enable-webrtc<WebKit.Settings.props.enable_webrtc>] property.
New in version 2.38.
- get_enable_write_console_messages_to_stdout()¶
-
Get the
WebKit.Settings:enable-write-console-messages-to-stdoutproperty.New in version 2.2.
- get_fantasy_font_family()¶
- Returns:
The default font family used to display content marked with fantasy font.
- Return type:
Gets the
WebKit.Settings:fantasy-font-familyproperty.
- get_feature_enabled(feature)¶
- Parameters:
feature (
WebKit.Feature) – the feature to toggle.- Returns:
Whether the feature is enabled.
- Return type:
Gets whether a feature is enabled.
New in version 2.42.
- get_hardware_acceleration_policy()¶
- Returns:
- Return type:
Get the
WebKit.Settings:hardware-acceleration-policyproperty.New in version 2.16.
- get_javascript_can_access_clipboard()¶
-
Get the
WebKit.Settings:javascript-can-access-clipboardproperty.
- get_javascript_can_open_windows_automatically()¶
-
Get the
WebKit.Settings:javascript-can-open-windows-automaticallyproperty.
- get_load_icons_ignoring_image_load_setting()¶
-
Setting no longer supported. This function returns
False.Deprecated since version 2.42.
- get_media_content_types_requiring_hardware_support()¶
-
Gets the
WebKit.Settings:media-content-types-requiring-hardware-supportproperty.New in version 2.30.
- get_media_playback_allows_inline()¶
- Returns:
TrueIf inline playback is allowed for media orFalseif only fullscreen playback is allowed.- Return type:
Get the
WebKit.Settings:media-playback-allows-inlineproperty.
- get_media_playback_requires_user_gesture()¶
- Returns:
TrueIf an user gesture is needed to play or load media orFalseif no user gesture is needed.- Return type:
Get the
WebKit.Settings:media-playback-requires-user-gestureproperty.
- get_minimum_font_size()¶
- Returns:
Minimum font size, in pixels.
- Return type:
Gets the
WebKit.Settings:minimum-font-sizeproperty.
- get_monospace_font_family()¶
- Returns:
Default font family used to display content marked with monospace font.
- Return type:
Gets the
WebKit.Settings:monospace-font-familyproperty.
- get_pictograph_font_family()¶
- Returns:
The default font family used to display content marked with pictograph font.
- Return type:
Gets the
WebKit.Settings:pictograph-font-familyproperty.
- get_print_backgrounds()¶
-
Get the
WebKit.Settings:print-backgroundsproperty.
- get_sans_serif_font_family()¶
- Returns:
The default font family used to display content marked with sans-serif font.
- Return type:
Gets the
WebKit.Settings:sans-serif-font-familyproperty.
- get_serif_font_family()¶
- Returns:
The default font family used to display content marked with serif font.
- Return type:
Gets the
WebKit.Settings:serif-font-familyproperty.
- get_user_agent()¶
- Returns:
The current value of the user-agent property.
- Return type:
Get the
WebKit.Settings:user-agentproperty.
- get_webrtc_udp_ports_range()¶
-
Get the [property`Settings`:py:data::webrtc-udp-ports-range<WebKit.Settings.props.webrtc_udp_ports_range>] property.
New in version 2.48.
- get_zoom_text_only()¶
- Returns:
TrueIf zoom level of the view should only affect the text orFalseif all view contents should be scaled.- Return type:
Get the
WebKit.Settings:zoom-text-onlyproperty.
- set_allow_file_access_from_file_urls(allowed)¶
- Parameters:
allowed (
bool) – Value to be set
Set the
WebKit.Settings:allow-file-access-from-file-urlsproperty.New in version 2.10.
- set_allow_modal_dialogs(allowed)¶
- Parameters:
allowed (
bool) – Value to be set
Set the
WebKit.Settings:allow-modal-dialogsproperty.
- Parameters:
allowed (
bool) – Value to be set
Set the
WebKit.Settings:allow-top-navigation-to-data-urlsproperty.New in version 2.28.
- set_allow_universal_access_from_file_urls(allowed)¶
- Parameters:
allowed (
bool) – Value to be set
Set the
WebKit.Settings:allow-universal-access-from-file-urlsproperty.New in version 2.14.
- set_auto_load_images(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:auto-load-imagesproperty.
- set_cursive_font_family(cursive_font_family)¶
- Parameters:
cursive_font_family (
str) – the new default cursive font family
Set the
WebKit.Settings:cursive-font-familyproperty.
- set_default_charset(default_charset)¶
- Parameters:
default_charset (
str) – default charset to be set
Set the
WebKit.Settings:default-charsetproperty.
- set_default_font_family(default_font_family)¶
- Parameters:
default_font_family (
str) – the new default font family
Set the
WebKit.Settings:default-font-familyproperty.
- set_default_font_size(font_size)¶
- Parameters:
font_size (
int) – default font size to be set in pixels
Set the
WebKit.Settings:default-font-sizeproperty.
- set_default_monospace_font_size(font_size)¶
- Parameters:
font_size (
int) – default monospace font size to be set in pixels
Set the
WebKit.Settings:default-monospace-font-sizeproperty.
- set_disable_web_security(disabled)¶
- Parameters:
disabled (
bool) – Value to be set
Set the
WebKit.Settings:disable-web-securityproperty.New in version 2.40.
- set_draw_compositing_indicators(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:draw-compositing-indicatorsproperty.
- set_enable_2d_canvas_acceleration(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-2d-canvas-accelerationproperty.New in version 2.46.
- Parameters:
enabled (
bool) – value to be set
Set the
WebKit.Settings:enable-back-forward-navigation-gesturesproperty.New in version 2.24.
- set_enable_caret_browsing(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-caret-browsingproperty.
- set_enable_developer_extras(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-developer-extrasproperty.
- set_enable_dns_prefetching(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-dns-prefetchingproperty.Deprecated since version 2.48..
- set_enable_encrypted_media(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-encrypted-mediaproperty.New in version 2.20.
- set_enable_fullscreen(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-fullscreenproperty.
- set_enable_html5_database(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-html5-databaseproperty.
- set_enable_html5_local_storage(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-html5-local-storageproperty.
- set_enable_hyperlink_auditing(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-hyperlink-auditingproperty.
- set_enable_javascript(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-javascriptproperty.
- set_enable_javascript_markup(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-javascript-markupproperty.New in version 2.24.
- set_enable_media(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-mediaproperty.New in version 2.26.
- set_enable_media_capabilities(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-media-capabilitiesproperty.New in version 2.22.
- set_enable_media_stream(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-media-streamproperty.New in version 2.4.
- set_enable_mediasource(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-mediasourceproperty.New in version 2.4.
- set_enable_mock_capture_devices(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-mock-capture-devicesproperty.New in version 2.4.
- set_enable_offline_web_application_cache(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Setting no longer supported. This function does nothing.
Deprecated since version 2.44.
- set_enable_page_cache(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-page-cacheproperty.
- set_enable_resizable_text_areas(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-resizable-text-areasproperty.
- set_enable_site_specific_quirks(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-site-specific-quirksproperty.
- set_enable_smooth_scrolling(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-smooth-scrollingproperty.
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-spatial-navigationproperty.New in version 2.2.
- set_enable_tabs_to_links(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-tabs-to-linksproperty.
- set_enable_webaudio(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-webaudioproperty.
- set_enable_webgl(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-webglproperty.
- set_enable_webrtc(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the [property`Settings`:py:data::enable-webrtc<WebKit.Settings.props.enable_webrtc>] property.
Setting this property to
Trueimplies the media-stream web-setting will also be enabled.New in version 2.38.
- set_enable_write_console_messages_to_stdout(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:enable-write-console-messages-to-stdoutproperty.New in version 2.2.
- set_fantasy_font_family(fantasy_font_family)¶
- Parameters:
fantasy_font_family (
str) – the new default fantasy font family
Set the
WebKit.Settings:fantasy-font-familyproperty.
- set_feature_enabled(feature, enabled)¶
- Parameters:
feature (
WebKit.Feature) – the feature to toggle.enabled (
bool) – whether the feature will be enabled.
Enables or disables a feature.
The current status of the feature can be determined with [id`webkit_settings_get_feature_enabled`]. To reset a feature to its initial status, pass the value returned by [id`webkit_feature_get_default_value`] as the enabled parameter.
New in version 2.42.
- set_hardware_acceleration_policy(policy)¶
- Parameters:
policy (
WebKit.HardwareAccelerationPolicy) – aWebKit.HardwareAccelerationPolicy
Set the
WebKit.Settings:hardware-acceleration-policyproperty.New in version 2.16.
- set_javascript_can_access_clipboard(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:javascript-can-access-clipboardproperty.
- set_javascript_can_open_windows_automatically(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:javascript-can-open-windows-automaticallyproperty.
- set_load_icons_ignoring_image_load_setting(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Setting no longer supported. This function does nothing.
Deprecated since version 2.42.
- set_media_content_types_requiring_hardware_support(content_types)¶
- Parameters:
content_types (
strorNone) – list of media content types requiring hardware support split by semicolons (:) orNoneto use the default value.
Set the
WebKit.Settings:media-content-types-requiring-hardware-supportproperty.New in version 2.30.
- set_media_playback_allows_inline(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:media-playback-allows-inlineproperty.
- set_media_playback_requires_user_gesture(enabled)¶
- Parameters:
enabled (
bool) – Value to be set
Set the
WebKit.Settings:media-playback-requires-user-gestureproperty.
- set_minimum_font_size(font_size)¶
- Parameters:
font_size (
int) – minimum font size to be set in pixels
Set the
WebKit.Settings:minimum-font-sizeproperty.
- set_monospace_font_family(monospace_font_family)¶
- Parameters:
monospace_font_family (
str) – the new default monospace font family
Set the
WebKit.Settings:monospace-font-familyproperty.
- set_pictograph_font_family(pictograph_font_family)¶
- Parameters:
pictograph_font_family (
str) – the new default pictograph font family
Set the
WebKit.Settings:pictograph-font-familyproperty.
- set_print_backgrounds(print_backgrounds)¶
- Parameters:
print_backgrounds (
bool) – Value to be set
Set the
WebKit.Settings:print-backgroundsproperty.
- set_sans_serif_font_family(sans_serif_font_family)¶
- Parameters:
sans_serif_font_family (
str) – the new default sans-serif font family
Set the
WebKit.Settings:sans-serif-font-familyproperty.
- set_serif_font_family(serif_font_family)¶
- Parameters:
serif_font_family (
str) – the new default serif font family
Set the
WebKit.Settings:serif-font-familyproperty.
- set_user_agent(user_agent)¶
- Parameters:
user_agent (
strorNone) – The new custom user agent string orNoneto use the default user agent
Set the
WebKit.Settings:user-agentproperty.
- set_user_agent_with_application_details(application_name, application_version)¶
- Parameters:
Set the
WebKit.Settings:user-agentproperty by appending the application details.Set the
WebKit.Settings:user-agentproperty 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.
- set_webrtc_udp_ports_range(udp_port_range)¶
- Parameters:
udp_port_range (
str) – Value to be set
Set the [property`Settings`:py:data::webrtc-udp-ports-range<WebKit.Settings.props.webrtc_udp_ports_range>] property.
New in version 2.48.
- set_zoom_text_only(zoom_text_only)¶
- Parameters:
zoom_text_only (
bool) – Value to be set
Set the
WebKit.Settings:zoom-text-onlyproperty.
Property Details¶
- WebKit.Settings.props.allow_file_access_from_file_urls¶
- Name:
allow-file-access-from-file-urls- Type:
- Default Value:
- Flags:
Whether file access is allowed from file URLs. By default, when something is loaded in a
WebKit.WebViewusing 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.New in version 2.10.
- WebKit.Settings.props.allow_modal_dialogs¶
-
Determine whether it’s allowed to create and run modal dialogs from a
WebKit.WebViewthrough JavaScript with window.showModalDialog. If it’s set toFalse, the associatedWebKit.WebViewwon’t be able to create new modal dialogs, so not even theWebKit.WebView::createsignal will be emitted.
- Name:
allow-top-navigation-to-data-urls- Type:
- Default Value:
- Flags:
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.
New in version 2.28.
- WebKit.Settings.props.allow_universal_access_from_file_urls¶
- Name:
allow-universal-access-from-file-urls- Type:
- Default Value:
- Flags:
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
WebKit.WebViewusing 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.New in version 2.14.
- WebKit.Settings.props.auto_load_images¶
-
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.
- WebKit.Settings.props.cursive_font_family¶
-
The font family used as the default for content using a cursive font.
- WebKit.Settings.props.default_charset¶
-
The default text charset used when interpreting content with an unspecified charset.
- WebKit.Settings.props.default_font_family¶
- Name:
default-font-family- Type:
- Default Value:
'sans-serif'- Flags:
The font family to use as the default for content that does not specify a font.
- WebKit.Settings.props.default_font_size¶
-
The default font size in pixels to use for content displayed if no font size is specified.
- WebKit.Settings.props.default_monospace_font_size¶
-
The default font size in pixels to use for content displayed in monospace font if no font size is specified.
- WebKit.Settings.props.disable_web_security¶
-
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.
New in version 2.40.
- WebKit.Settings.props.draw_compositing_indicators¶
- Name:
draw-compositing-indicators- Type:
- Default Value:
- Flags:
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.
- WebKit.Settings.props.enable_2d_canvas_acceleration¶
- Name:
enable-2d-canvas-acceleration- Type:
- Default Value:
- Flags:
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.
New in version 2.46.
- Name:
enable-back-forward-navigation-gestures- Type:
- Default Value:
- Flags:
Enable or disable horizontal swipe gesture for back-forward navigation.
New in version 2.24.
- WebKit.Settings.props.enable_caret_browsing¶
-
Whether to enable accessibility enhanced keyboard navigation.
- WebKit.Settings.props.enable_developer_extras¶
-
Determines whether or not developer tools, such as the Web Inspector, are enabled.
- WebKit.Settings.props.enable_dns_prefetching¶
- Name:
enable-dns-prefetching- Type:
- Default Value:
- Flags:
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.
- WebKit.Settings.props.enable_encrypted_media¶
-
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/
New in version 2.20.
- WebKit.Settings.props.enable_fullscreen¶
-
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/
- WebKit.Settings.props.enable_html5_database¶
-
Whether to enable HTML5 client-side SQL database support (IndexedDB).
- WebKit.Settings.props.enable_html5_local_storage¶
- Name:
enable-html5-local-storage- Type:
- Default Value:
- Flags:
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/.
- WebKit.Settings.props.enable_hyperlink_auditing¶
-
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.
- WebKit.Settings.props.enable_javascript¶
-
Determines whether or not JavaScript executes within a page.
- WebKit.Settings.props.enable_javascript_markup¶
-
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
WebKit.Settings:enable-javascriptisTrue.New in version 2.24.
- WebKit.Settings.props.enable_media¶
-
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.New in version 2.26.
- WebKit.Settings.props.enable_media_capabilities¶
- Name:
enable-media-capabilities- Type:
- Default Value:
- Flags:
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/
New in version 2.22.
- WebKit.Settings.props.enable_media_stream¶
-
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
New in version 2.4.
- WebKit.Settings.props.enable_mediasource¶
-
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/
New in version 2.4.
- WebKit.Settings.props.enable_mock_capture_devices¶
- Name:
enable-mock-capture-devices- Type:
- Default Value:
- Flags:
Enable or disable the Mock Capture Devices. Those are fake Microphone and Camera devices to be used as MediaStream sources.
New in version 2.24.
- WebKit.Settings.props.enable_offline_web_application_cache¶
- Name:
enable-offline-web-application-cache- Type:
- Default Value:
- Flags:
Unsupported setting. This property does nothing.
Deprecated since version 2.44.
- WebKit.Settings.props.enable_page_cache¶
-
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/
- WebKit.Settings.props.enable_resizable_text_areas¶
- Name:
enable-resizable-text-areas- Type:
- Default Value:
- Flags:
Determines whether or not text areas can be resized.
- WebKit.Settings.props.enable_site_specific_quirks¶
- Name:
enable-site-specific-quirks- Type:
- Default Value:
- Flags:
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.
- WebKit.Settings.props.enable_smooth_scrolling¶
-
Enable or disable smooth scrolling.
- Name:
enable-spatial-navigation- Type:
- Default Value:
- Flags:
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.
New in version 2.4.
- WebKit.Settings.props.enable_tabs_to_links¶
-
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.
- WebKit.Settings.props.enable_webaudio¶
-
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
- WebKit.Settings.props.enable_webgl¶
-
Enable or disable support for WebGL on pages. WebGL enables web content to use an API based on OpenGL ES 2.0.
- WebKit.Settings.props.enable_webrtc¶
-
Enable WebRTC support for loaded pages.
Enabling this setting implies that [property`Settings`:py:data::enable-media-stream<WebKit.Settings.props.enable_media_stream>] will be enabled as well.
See also https://www.w3.org/TR/webrtc/
New in version 2.38.
- WebKit.Settings.props.enable_write_console_messages_to_stdout¶
- Name:
enable-write-console-messages-to-stdout- Type:
- Default Value:
- Flags:
Enable or disable writing console messages to stdout. These are messages sent to the console with console.log and related methods.
New in version 2.2.
- WebKit.Settings.props.fantasy_font_family¶
-
The font family used as the default for content using a fantasy font.
- WebKit.Settings.props.hardware_acceleration_policy¶
- Name:
hardware-acceleration-policy- Type:
- Default Value:
- Flags:
The
WebKit.HardwareAccelerationPolicyto 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.
New in version 2.16.
- WebKit.Settings.props.javascript_can_access_clipboard¶
- Name:
javascript-can-access-clipboard- Type:
- Default Value:
- Flags:
Whether JavaScript can access the clipboard. The default value is
False. If set toTrue, document.execCommand() allows cut, copy and paste commands.
- WebKit.Settings.props.javascript_can_open_windows_automatically¶
- Name:
javascript-can-open-windows-automatically- Type:
- Default Value:
- Flags:
Whether JavaScript can open popup windows automatically without user intervention.
- WebKit.Settings.props.load_icons_ignoring_image_load_setting¶
- Name:
load-icons-ignoring-image-load-setting- Type:
- Default Value:
- Flags:
Unsupported setting. This property does nothing.
Deprecated since version 2.42.
- WebKit.Settings.props.media_content_types_requiring_hardware_support¶
- Name:
media-content-types-requiring-hardware-support- Type:
- Default Value:
- Flags:
List of media content types requiring hardware support, split by semicolons (:). For example: ‘video/webm; codecs=”vp*”
:video/mp4; codecs=”avc*”:video/* codecs=”av1*”’.New in version 2.30.
- WebKit.Settings.props.media_playback_allows_inline¶
- Name:
media-playback-allows-inline- Type:
- Default Value:
- Flags:
Whether media playback is full-screen only or inline playback is allowed. This is
Trueby default, so media playback can be inline. Setting it toFalseallows specifying that media playback should be always fullscreen.
- WebKit.Settings.props.media_playback_requires_user_gesture¶
- Name:
media-playback-requires-user-gesture- Type:
- Default Value:
- Flags:
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.
- WebKit.Settings.props.minimum_font_size¶
-
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.
- WebKit.Settings.props.monospace_font_family¶
- Name:
monospace-font-family- Type:
- Default Value:
'monospace'- Flags:
The font family used as the default for content using a monospace font.
- WebKit.Settings.props.pictograph_font_family¶
-
The font family used as the default for content using a pictograph font.
- WebKit.Settings.props.print_backgrounds¶
-
Whether background images should be drawn during printing.
- WebKit.Settings.props.sans_serif_font_family¶
- Name:
sans-serif-font-family- Type:
- Default Value:
'sans-serif'- Flags:
The font family used as the default for content using a sans-serif font.
- WebKit.Settings.props.serif_font_family¶
-
The font family used as the default for content using a serif font.
- WebKit.Settings.props.user_agent¶
-
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
WebKit.Settings.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.
- WebKit.Settings.props.webrtc_udp_ports_range¶
-
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.
New in version 2.48.
- WebKit.Settings.props.zoom_text_only¶
-
Whether
WebKit.WebView:zoom-levelaffects 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.