WebKit2.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 |
||
d/r/w/c |
Whether to enable accelerated 2D canvas |
||
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 |
||
r/w/c |
Whether to enable DNS prefetching |
||
r/w/c |
Whether EncryptedMedia should be enabled. |
||
d/r/w/c |
Whether to enable frame flattening. |
||
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. |
||
d/r/w/c |
Whether Java support should be enabled. |
||
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 |
||
d/r/w/c |
Enable embedded plugin objects. |
||
d/r/w/c |
Whether to enable private browsing |
||
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 |
||
d/r/w/c |
Whether to enable the XSS auditor. |
||
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 |
Whether zoom level of web view changes only the text size |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2.Settings(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Control the behaviour of a
WebKit2.WebView
.WebKit2.Settings
can be applied to aWebKit2.WebView
to control text charset, color, font sizes, printing mode, script support, loading of images and various other things on aWebKit2.WebView
. After creation, aWebKit2.Settings
object 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.
Convert points to the equivalent value in pixels, based on the current screen DPI. 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
WebKit2.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.
Convert pixels to the equivalent value in points, based on the current screen DPI. 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
WebKit2.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
WebKit2.Settings
instance.- Return type:
Creates a new
WebKit2.Settings
instance with default values.It must be manually attached to a
WebKit2.WebView
. See also webkit_settings_new_with_settings().
- get_allow_file_access_from_file_urls()¶
-
Get the
WebKit2.Settings
:allow-file-access-from-file-urls
property.New in version 2.10.
- get_allow_modal_dialogs()¶
-
Get the
WebKit2.Settings
:allow-modal-dialogs
property.
- Returns:
True
If navigation to data URLs from the top frame is allowed orFalse
\ otherwise.- Return type:
Get the
WebKit2.Settings
:allow-top-navigation-to-data-urls
property.New in version 2.28.
- get_allow_universal_access_from_file_urls()¶
-
Get the
WebKit2.Settings
:allow-universal-access-from-file-urls
property.New in version 2.14.
- get_auto_load_images()¶
-
Get the
WebKit2.Settings
:auto-load-images
property.
- get_cursive_font_family()¶
- Returns:
The default font family used to display content marked with cursive font.
- Return type:
Gets the
WebKit2.Settings
:cursive-font-family
property.
- get_default_charset()¶
- Returns:
Default charset.
- Return type:
Gets the
WebKit2.Settings
:default-charset
property.
- get_default_font_family()¶
- Returns:
The default font family used to display content that does not specify a font.
- Return type:
Gets the
WebKit2.Settings
:default-font-family
property.
- get_default_font_size()¶
- Returns:
The default font size, in pixels.
- Return type:
Gets the
WebKit2.Settings
:default-font-size
property.
- get_default_monospace_font_size()¶
- Returns:
Default monospace font size, in pixels.
- Return type:
Gets the
WebKit2.Settings
:default-monospace-font-size
property.
- get_disable_web_security()¶
-
Get the
WebKit2.Settings
:disable-web-security
property.New in version 2.40.
- get_draw_compositing_indicators()¶
-
Get the
WebKit2.Settings
:draw-compositing-indicators
property.
- get_enable_accelerated_2d_canvas()¶
-
Get the
WebKit2.Settings
:enable-accelerated-2d-canvas
property.New in version 2.2.
Deprecated since version 2.32..
- Returns:
True
if horizontal swipe gesture will trigger back-forward navigaiton orFalse
otherwise.- Return type:
Get the
WebKit2.Settings
:enable-back-forward-navigation-gestures
property.New in version 2.24.
- get_enable_caret_browsing()¶
-
Get the
WebKit2.Settings
:enable-caret-browsing
property.
- get_enable_developer_extras()¶
-
Get the
WebKit2.Settings
:enable-developer-extras
property.
- get_enable_dns_prefetching()¶
-
Get the
WebKit2.Settings
:enable-dns-prefetching
property.
- get_enable_encrypted_media()¶
-
Get the
WebKit2.Settings
:enable-encrypted-media
property.New in version 2.20.
- get_enable_frame_flattening()¶
-
Frame flattening is no longer supported. This function returns
False
.Deprecated since version 2.38.
- get_enable_fullscreen()¶
-
Get the
WebKit2.Settings
:enable-fullscreen
property.
- get_enable_html5_database()¶
-
Get the
WebKit2.Settings
:enable-html5-database
property.
- get_enable_html5_local_storage()¶
-
Get the
WebKit2.Settings
:enable-html5-local-storage
property.
- get_enable_hyperlink_auditing()¶
-
Get the
WebKit2.Settings
:enable-hyperlink-auditing
property.
- get_enable_java()¶
-
Get the
WebKit2.Settings
:enable-java
property.Deprecated since version 2.38.: This function always returns
False
.
- get_enable_javascript()¶
-
Get the
WebKit2.Settings
:enable-javascript
property.
- get_enable_javascript_markup()¶
-
Get the
WebKit2.Settings
:enable-javascript-markup
property.New in version 2.24.
- get_enable_media()¶
-
Get the
WebKit2.Settings
:enable-media
property.New in version 2.26.
- get_enable_media_capabilities()¶
-
Get the
WebKit2.Settings
:enable-media-capabilities
property.New in version 2.22.
- get_enable_media_stream()¶
-
Get the
WebKit2.Settings
:enable-media-stream
property.New in version 2.4.
- get_enable_mediasource()¶
-
Get the
WebKit2.Settings
:enable-mediasource
property.New in version 2.4.
- get_enable_mock_capture_devices()¶
-
Get the
WebKit2.Settings
:enable-mock-capture-devices
property.New in version 2.24.
- get_enable_offline_web_application_cache()¶
-
Get the
WebKit2.Settings
:enable-offline-web-application-cache
property.Deprecated since version 2.44.
- get_enable_page_cache()¶
-
Get the
WebKit2.Settings
:enable-page-cache
property.
- get_enable_plugins()¶
-
Get the
WebKit2.Settings
:enable-plugins
property.Deprecated since version 2.32.
- get_enable_private_browsing()¶
-
Get the
WebKit2.Settings
:enable-private-browsing
property.Deprecated since version 2.16.: Use
WebKit2.WebView
:is-ephemeral
orWebKit2.WebContext
:is-ephemeral
instead.
- get_enable_resizable_text_areas()¶
-
Get the
WebKit2.Settings
:enable-resizable-text-areas
property.
- get_enable_site_specific_quirks()¶
-
Get the
WebKit2.Settings
:enable-site-specific-quirks
property.
- get_enable_smooth_scrolling()¶
-
Get the
WebKit2.Settings
:enable-smooth-scrolling
property.
-
Get the
WebKit2.Settings
:enable-spatial-navigation
property.New in version 2.2.
- get_enable_tabs_to_links()¶
-
Get the
WebKit2.Settings
:enable-tabs-to-links
property.
- get_enable_webaudio()¶
-
Get the
WebKit2.Settings
:enable-webaudio
property.
- get_enable_webgl()¶
-
Get the
WebKit2.Settings
:enable-webgl
property.
- get_enable_webrtc()¶
-
Get the [property`Settings`:py:data::enable-webrtc<WebKit2.Settings.props.enable_webrtc>] property.
New in version 2.38.
- get_enable_write_console_messages_to_stdout()¶
-
Get the
WebKit2.Settings
:enable-write-console-messages-to-stdout
property.New in version 2.2.
- get_enable_xss_auditor()¶
-
The XSS auditor has been removed. This function returns
False
.Deprecated since version 2.38.: This function does nothing.
- get_fantasy_font_family()¶
- Returns:
The default font family used to display content marked with fantasy font.
- Return type:
Gets the
WebKit2.Settings
:fantasy-font-family
property.
- get_feature_enabled(feature)¶
- Parameters:
feature (
WebKit2.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
WebKit2.Settings
:hardware-acceleration-policy
property.New in version 2.16.
- get_javascript_can_access_clipboard()¶
-
Get the
WebKit2.Settings
:javascript-can-access-clipboard
property.
- get_javascript_can_open_windows_automatically()¶
-
Get the
WebKit2.Settings
:javascript-can-open-windows-automatically
property.
- 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
WebKit2.Settings
:media-content-types-requiring-hardware-support
property.New in version 2.30.
- get_media_playback_allows_inline()¶
- Returns:
True
If inline playback is allowed for media orFalse
if only fullscreen playback is allowed.- Return type:
Get the
WebKit2.Settings
:media-playback-allows-inline
property.
- get_media_playback_requires_user_gesture()¶
- Returns:
True
If an user gesture is needed to play or load media orFalse
if no user gesture is needed.- Return type:
Get the
WebKit2.Settings
:media-playback-requires-user-gesture
property.
- get_minimum_font_size()¶
- Returns:
Minimum font size, in pixels.
- Return type:
Gets the
WebKit2.Settings
:minimum-font-size
property.
- get_monospace_font_family()¶
- Returns:
Default font family used to display content marked with monospace font.
- Return type:
Gets the
WebKit2.Settings
:monospace-font-family
property.
- get_pictograph_font_family()¶
- Returns:
The default font family used to display content marked with pictograph font.
- Return type:
Gets the
WebKit2.Settings
:pictograph-font-family
property.
- get_print_backgrounds()¶
-
Get the
WebKit2.Settings
:print-backgrounds
property.
- get_sans_serif_font_family()¶
- Returns:
The default font family used to display content marked with sans-serif font.
- Return type:
Gets the
WebKit2.Settings
:sans-serif-font-family
property.
- get_serif_font_family()¶
- Returns:
The default font family used to display content marked with serif font.
- Return type:
Gets the
WebKit2.Settings
:serif-font-family
property.
- get_user_agent()¶
- Returns:
The current value of the user-agent property.
- Return type:
Get the
WebKit2.Settings
:user-agent
property.
- get_zoom_text_only()¶
- Returns:
True
If zoom level of the view should only affect the text orFalse
if all view contents should be scaled.- Return type:
Get the
WebKit2.Settings
:zoom-text-only
property.
- set_allow_file_access_from_file_urls(allowed)¶
- Parameters:
allowed (
bool
) – Value to be set
Set the
WebKit2.Settings
:allow-file-access-from-file-urls
property.New in version 2.10.
- set_allow_modal_dialogs(allowed)¶
- Parameters:
allowed (
bool
) – Value to be set
Set the
WebKit2.Settings
:allow-modal-dialogs
property.
- Parameters:
allowed (
bool
) – Value to be set
Set the
WebKit2.Settings
:allow-top-navigation-to-data-urls
property.New in version 2.28.
- set_allow_universal_access_from_file_urls(allowed)¶
- Parameters:
allowed (
bool
) – Value to be set
Set the
WebKit2.Settings
:allow-universal-access-from-file-urls
property.New in version 2.14.
- set_auto_load_images(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:auto-load-images
property.
- set_cursive_font_family(cursive_font_family)¶
- Parameters:
cursive_font_family (
str
) – the new default cursive font family
Set the
WebKit2.Settings
:cursive-font-family
property.
- set_default_charset(default_charset)¶
- Parameters:
default_charset (
str
) – default charset to be set
Set the
WebKit2.Settings
:default-charset
property.
- set_default_font_family(default_font_family)¶
- Parameters:
default_font_family (
str
) – the new default font family
Set the
WebKit2.Settings
:default-font-family
property.
- set_default_font_size(font_size)¶
- Parameters:
font_size (
int
) – default font size to be set in pixels
Set the
WebKit2.Settings
:default-font-size
property.
- set_default_monospace_font_size(font_size)¶
- Parameters:
font_size (
int
) – default monospace font size to be set in pixels
Set the
WebKit2.Settings
:default-monospace-font-size
property.
- set_disable_web_security(disabled)¶
- Parameters:
disabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:disable-web-security
property.New in version 2.40.
- set_draw_compositing_indicators(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:draw-compositing-indicators
property.
- set_enable_accelerated_2d_canvas(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-accelerated-2d-canvas
property.New in version 2.2.
Deprecated since version 2.32..
- Parameters:
enabled (
bool
) – value to be set
Set the
WebKit2.Settings
:enable-back-forward-navigation-gestures
property.New in version 2.24.
- set_enable_caret_browsing(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-caret-browsing
property.
- set_enable_developer_extras(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-developer-extras
property.
- set_enable_dns_prefetching(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-dns-prefetching
property.
- set_enable_encrypted_media(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-encrypted-media
property.New in version 2.20.
- set_enable_frame_flattening(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Frame flattening is no longer supported. This function does nothing.
Deprecated since version 2.38.
- set_enable_fullscreen(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-fullscreen
property.
- set_enable_html5_database(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-html5-database
property.
- set_enable_html5_local_storage(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-html5-local-storage
property.
- set_enable_hyperlink_auditing(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-hyperlink-auditing
property.
- set_enable_java(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-java
property.Deprecated function that does nothing.
Deprecated since version 2.38.: This function does nothing.
- set_enable_javascript(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-javascript
property.
- set_enable_javascript_markup(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-javascript-markup
property.New in version 2.24.
- set_enable_media(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-media
property.New in version 2.26.
- set_enable_media_capabilities(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-media-capabilities
property.New in version 2.22.
- set_enable_media_stream(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-media-stream
property.New in version 2.4.
- set_enable_mediasource(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-mediasource
property.New in version 2.4.
- set_enable_mock_capture_devices(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-mock-capture-devices
property.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
WebKit2.Settings
:enable-page-cache
property.
- set_enable_plugins(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-plugins
property.Deprecated since version 2.32.
- set_enable_private_browsing(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-private-browsing
property.Deprecated since version 2.16.: Use
WebKit2.WebView
:is-ephemeral
orWebKit2.WebContext
:is-ephemeral
instead.
- set_enable_resizable_text_areas(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-resizable-text-areas
property.
- set_enable_site_specific_quirks(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-site-specific-quirks
property.
- set_enable_smooth_scrolling(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-smooth-scrolling
property.
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-spatial-navigation
property.New in version 2.2.
- set_enable_tabs_to_links(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-tabs-to-links
property.
- set_enable_webaudio(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-webaudio
property.
- set_enable_webgl(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:enable-webgl
property.
- set_enable_webrtc(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the [property`Settings`:py:data::enable-webrtc<WebKit2.Settings.props.enable_webrtc>] property.
Setting this property to
True
implies 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
WebKit2.Settings
:enable-write-console-messages-to-stdout
property.New in version 2.2.
- set_enable_xss_auditor(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
The XSS auditor has been removed. This function does nothing.
Deprecated since version 2.38.: This function does nothing.
- set_fantasy_font_family(fantasy_font_family)¶
- Parameters:
fantasy_font_family (
str
) – the new default fantasy font family
Set the
WebKit2.Settings
:fantasy-font-family
property.
- set_feature_enabled(feature, enabled)¶
- Parameters:
feature (
WebKit2.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 (
WebKit2.HardwareAccelerationPolicy
) – aWebKit2.HardwareAccelerationPolicy
Set the
WebKit2.Settings
:hardware-acceleration-policy
property.New in version 2.16.
- set_javascript_can_access_clipboard(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:javascript-can-access-clipboard
property.
- set_javascript_can_open_windows_automatically(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:javascript-can-open-windows-automatically
property.
- 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 (
str
orNone
) – list of media content types requiring hardware support split by semicolons (:) orNone
to use the default value.
Set the
WebKit2.Settings
:media-content-types-requiring-hardware-support
property.New in version 2.30.
- set_media_playback_allows_inline(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:media-playback-allows-inline
property.
- set_media_playback_requires_user_gesture(enabled)¶
- Parameters:
enabled (
bool
) – Value to be set
Set the
WebKit2.Settings
:media-playback-requires-user-gesture
property.
- set_minimum_font_size(font_size)¶
- Parameters:
font_size (
int
) – minimum font size to be set in pixels
Set the
WebKit2.Settings
:minimum-font-size
property.
- set_monospace_font_family(monospace_font_family)¶
- Parameters:
monospace_font_family (
str
) – the new default monospace font family
Set the
WebKit2.Settings
:monospace-font-family
property.
- set_pictograph_font_family(pictograph_font_family)¶
- Parameters:
pictograph_font_family (
str
) – the new default pictograph font family
Set the
WebKit2.Settings
:pictograph-font-family
property.
- set_print_backgrounds(print_backgrounds)¶
- Parameters:
print_backgrounds (
bool
) – Value to be set
Set the
WebKit2.Settings
:print-backgrounds
property.
- set_sans_serif_font_family(sans_serif_font_family)¶
- Parameters:
sans_serif_font_family (
str
) – the new default sans-serif font family
Set the
WebKit2.Settings
:sans-serif-font-family
property.
- set_serif_font_family(serif_font_family)¶
- Parameters:
serif_font_family (
str
) – the new default serif font family
Set the
WebKit2.Settings
:serif-font-family
property.
- set_user_agent(user_agent)¶
- Parameters:
user_agent (
str
orNone
) – The new custom user agent string orNone
to use the default user agent
Set the
WebKit2.Settings
:user-agent
property.
- set_user_agent_with_application_details(application_name, application_version)¶
- Parameters:
Set the
WebKit2.Settings
:user-agent
property by appending the application details.Set the
WebKit2.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.
- set_zoom_text_only(zoom_text_only)¶
- Parameters:
zoom_text_only (
bool
) – Value to be set
Set the
WebKit2.Settings
:zoom-text-only
property.
Property Details¶
- WebKit2.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
WebKit2.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.New in version 2.10.
- WebKit2.Settings.props.allow_modal_dialogs¶
-
Determine whether it’s allowed to create and run modal dialogs from a
WebKit2.WebView
through JavaScript with window.showModalDialog. If it’s set toFalse
, the associatedWebKit2.WebView
won’t be able to create new modal dialogs, so not even theWebKit2.WebView
::create
signal 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.
- WebKit2.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
WebKit2.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.New in version 2.14.
- WebKit2.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.
- WebKit2.Settings.props.cursive_font_family¶
-
The font family used as the default for content using a cursive font.
- WebKit2.Settings.props.default_charset¶
-
The default text charset used when interpreting content with an unspecified charset.
- WebKit2.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.
- WebKit2.Settings.props.default_font_size¶
-
The default font size in pixels to use for content displayed if no font size is specified.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.Settings.props.enable_accelerated_2d_canvas¶
- Name:
enable-accelerated-2d-canvas
- Type:
- Default Value:
- Flags:
Enable or disable accelerated 2D canvas. Accelerated 2D canvas is only available if WebKit was compiled with a version of Cairo including the unstable CairoGL API. When accelerated 2D canvas is enabled, WebKit may render some 2D canvas content using hardware accelerated drawing operations.
New in version 2.2.
Deprecated since version 2.32..
- 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.
- WebKit2.Settings.props.enable_caret_browsing¶
-
Whether to enable accessibility enhanced keyboard navigation.
- WebKit2.Settings.props.enable_developer_extras¶
-
Determines whether or not developer tools, such as the Web Inspector, are enabled.
- WebKit2.Settings.props.enable_dns_prefetching¶
-
Determines whether or not to prefetch domain names. DNS prefetching attempts to resolve domain names before a user tries to follow a link.
- WebKit2.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.
- WebKit2.Settings.props.enable_frame_flattening¶
- Name:
enable-frame-flattening
- Type:
- Default Value:
- Flags:
Frame flattening is no longer supported. This property does nothing.
Deprecated since version 2.38.
- WebKit2.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/
- WebKit2.Settings.props.enable_html5_database¶
-
Whether to enable HTML5 client-side SQL database support (IndexedDB).
- WebKit2.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/.
- WebKit2.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.
- WebKit2.Settings.props.enable_java¶
-
Determines whether or not Java is enabled on the page.
Deprecated since version 2.38.
- WebKit2.Settings.props.enable_javascript¶
-
Determines whether or not JavaScript executes within a page.
- WebKit2.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
WebKit2.Settings
:enable-javascript
isTrue
.New in version 2.24.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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/
- WebKit2.Settings.props.enable_plugins¶
- Name:
enable-plugins
- Type:
- Default Value:
- Flags:
Determines whether or not plugins on the page are enabled.
Deprecated since version 2.32.
- WebKit2.Settings.props.enable_private_browsing¶
- Name:
enable-private-browsing
- Type:
- Default Value:
- Flags:
Determines whether or not private browsing is enabled. Private browsing will disable history, cache and form auto-fill for any pages visited.
Deprecated since version 2.16.: Use
WebKit2.WebView
:is-ephemeral
orWebKit2.WebsiteDataManager
:is-ephemeral
instead.
- WebKit2.Settings.props.enable_resizable_text_areas¶
- Name:
enable-resizable-text-areas
- Type:
- Default Value:
- Flags:
Determines whether or not text areas can be resized.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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
- WebKit2.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.
- WebKit2.Settings.props.enable_webrtc¶
-
Enable WebRTC support for loaded pages.
Enabling this setting implies that [property`Settings`:py:data::enable-media-stream<WebKit2.Settings.props.enable_media_stream>] will be enabled as well.
See also https://www.w3.org/TR/webrtc/
New in version 2.38.
- WebKit2.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.
- WebKit2.Settings.props.enable_xss_auditor¶
- Name:
enable-xss-auditor
- Type:
- Default Value:
- Flags:
Whether to enable the XSS auditor. This feature filters some kinds of reflective XSS attacks on vulnerable web sites.
Deprecated since version 2.38.
- WebKit2.Settings.props.fantasy_font_family¶
-
The font family used as the default for content using a fantasy font.
- WebKit2.Settings.props.hardware_acceleration_policy¶
- Name:
hardware-acceleration-policy
- Type:
- Default Value:
- Flags:
The
WebKit2.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.
New in version 2.16.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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
True
by default, so media playback can be inline. Setting it toFalse
allows specifying that media playback should be always fullscreen.
- WebKit2.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.
- WebKit2.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.
- WebKit2.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.
- WebKit2.Settings.props.pictograph_font_family¶
-
The font family used as the default for content using a pictograph font.
- WebKit2.Settings.props.print_backgrounds¶
-
Whether background images should be drawn during printing.
- WebKit2.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.
- WebKit2.Settings.props.serif_font_family¶
-
The font family used as the default for content using a serif font.
- WebKit2.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
WebKit2.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.
- WebKit2.Settings.props.zoom_text_only¶
-
Whether
WebKit2.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.