Struct webkit2gtk::builders::SettingsBuilder
source · [−]pub struct SettingsBuilder { /* private fields */ }
Expand description
A builder-pattern type to construct Settings
objects.
Implementations
sourceimpl SettingsBuilder
impl SettingsBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new SettingsBuilder
.
sourcepub fn allow_file_access_from_file_urls(
self,
allow_file_access_from_file_urls: bool
) -> Self
Available on crate feature v2_10
only.
pub fn allow_file_access_from_file_urls(
self,
allow_file_access_from_file_urls: bool
) -> Self
v2_10
only.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.
sourcepub fn allow_modal_dialogs(self, allow_modal_dialogs: bool) -> Self
pub fn allow_modal_dialogs(self, allow_modal_dialogs: bool) -> Self
Available on crate feature v2_28
only.
v2_28
only.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.
sourcepub fn allow_universal_access_from_file_urls(
self,
allow_universal_access_from_file_urls: bool
) -> Self
Available on crate feature v2_14
only.
pub fn allow_universal_access_from_file_urls(
self,
allow_universal_access_from_file_urls: bool
) -> Self
v2_14
only.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.
sourcepub fn auto_load_images(self, auto_load_images: bool) -> Self
pub fn auto_load_images(self, auto_load_images: bool) -> Self
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.
sourcepub fn cursive_font_family(self, cursive_font_family: &str) -> Self
pub fn cursive_font_family(self, cursive_font_family: &str) -> Self
The font family used as the default for content using a cursive font.
sourcepub fn default_charset(self, default_charset: &str) -> Self
pub fn default_charset(self, default_charset: &str) -> Self
The default text charset used when interpreting content with an unspecified charset.
sourcepub fn default_font_family(self, default_font_family: &str) -> Self
pub fn default_font_family(self, default_font_family: &str) -> Self
The font family to use as the default for content that does not specify a font.
sourcepub fn default_font_size(self, default_font_size: u32) -> Self
pub fn default_font_size(self, default_font_size: u32) -> Self
The default font size in pixels to use for content displayed if no font size is specified.
sourcepub fn default_monospace_font_size(
self,
default_monospace_font_size: u32
) -> Self
pub fn default_monospace_font_size(
self,
default_monospace_font_size: u32
) -> Self
The default font size in pixels to use for content displayed in monospace font if no font size is specified.
sourcepub fn draw_compositing_indicators(
self,
draw_compositing_indicators: bool
) -> Self
pub fn draw_compositing_indicators(
self,
draw_compositing_indicators: bool
) -> Self
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.
sourcepub fn enable_accelerated_2d_canvas(
self,
enable_accelerated_2d_canvas: bool
) -> Self
👎Deprecated: Since 2.32Available on crate feature v2_2
only.
pub fn enable_accelerated_2d_canvas(
self,
enable_accelerated_2d_canvas: bool
) -> Self
v2_2
only.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.
Available on crate feature v2_24
only.
v2_24
only.Enable or disable horizontal swipe gesture for back-forward navigation.
sourcepub fn enable_caret_browsing(self, enable_caret_browsing: bool) -> Self
pub fn enable_caret_browsing(self, enable_caret_browsing: bool) -> Self
Whether to enable accessibility enhanced keyboard navigation.
sourcepub fn enable_developer_extras(self, enable_developer_extras: bool) -> Self
pub fn enable_developer_extras(self, enable_developer_extras: bool) -> Self
Determines whether or not developer tools, such as the Web Inspector, are enabled.
sourcepub fn enable_dns_prefetching(self, enable_dns_prefetching: bool) -> Self
pub fn enable_dns_prefetching(self, enable_dns_prefetching: bool) -> Self
Determines whether or not to prefetch domain names. DNS prefetching attempts to resolve domain names before a user tries to follow a link.
sourcepub fn enable_encrypted_media(self, enable_encrypted_media: bool) -> Self
Available on crate feature v2_20
only.
pub fn enable_encrypted_media(self, enable_encrypted_media: bool) -> Self
v2_20
only.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/
sourcepub fn enable_frame_flattening(self, enable_frame_flattening: bool) -> Self
pub fn enable_frame_flattening(self, enable_frame_flattening: bool) -> Self
Whether to enable the frame flattening. With this setting each subframe is expanded to its contents, which will flatten all the frames to become one scrollable page. On touch devices scrollable subframes on a page can result in a confusing user experience.
sourcepub fn enable_fullscreen(self, enable_fullscreen: bool) -> Self
pub fn enable_fullscreen(self, enable_fullscreen: bool) -> Self
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/
sourcepub fn enable_html5_database(self, enable_html5_database: bool) -> Self
pub fn enable_html5_database(self, enable_html5_database: bool) -> Self
Whether to enable HTML5 client-side SQL database support (IndexedDB).
sourcepub fn enable_html5_local_storage(self, enable_html5_local_storage: bool) -> Self
pub fn enable_html5_local_storage(self, enable_html5_local_storage: bool) -> Self
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/.
sourcepub fn enable_hyperlink_auditing(self, enable_hyperlink_auditing: bool) -> Self
pub fn enable_hyperlink_auditing(self, enable_hyperlink_auditing: bool) -> Self
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.htmlhyperlink
-auditing.
sourcepub fn enable_java(self, enable_java: bool) -> Self
pub fn enable_java(self, enable_java: bool) -> Self
Determines whether or not Java is enabled on the page.
sourcepub fn enable_javascript(self, enable_javascript: bool) -> Self
pub fn enable_javascript(self, enable_javascript: bool) -> Self
Determines whether or not JavaScript executes within a page.
sourcepub fn enable_javascript_markup(self, enable_javascript_markup: bool) -> Self
Available on crate feature v2_24
only.
pub fn enable_javascript_markup(self, enable_javascript_markup: bool) -> Self
v2_24
only.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 property::Settings::enable-javascript
is true
.
sourcepub fn enable_media(self, enable_media: bool) -> Self
Available on crate feature v2_26
only.
pub fn enable_media(self, enable_media: bool) -> Self
v2_26
only.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.
sourcepub fn enable_media_capabilities(self, enable_media_capabilities: bool) -> Self
Available on crate feature v2_22
only.
pub fn enable_media_capabilities(self, enable_media_capabilities: bool) -> Self
v2_22
only.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/
sourcepub fn enable_media_stream(self, enable_media_stream: bool) -> Self
Available on crate feature v2_4
only.
pub fn enable_media_stream(self, enable_media_stream: bool) -> Self
v2_4
only.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
sourcepub fn enable_mediasource(self, enable_mediasource: bool) -> Self
Available on crate feature v2_4
only.
pub fn enable_mediasource(self, enable_mediasource: bool) -> Self
v2_4
only.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/
sourcepub fn enable_mock_capture_devices(
self,
enable_mock_capture_devices: bool
) -> Self
Available on crate feature v2_24
only.
pub fn enable_mock_capture_devices(
self,
enable_mock_capture_devices: bool
) -> Self
v2_24
only.Enable or disable the Mock Capture Devices. Those are fake Microphone and Camera devices to be used as MediaStream sources.
sourcepub fn enable_offline_web_application_cache(
self,
enable_offline_web_application_cache: bool
) -> Self
pub fn enable_offline_web_application_cache(
self,
enable_offline_web_application_cache: bool
) -> Self
Whether to enable HTML5 offline web application cache support. Offline web application cache allows web applications to run even when the user is not connected to the network.
HTML5 offline web application specification is available at http://dev.w3.org/html5/spec/offline.html.
sourcepub fn enable_page_cache(self, enable_page_cache: bool) -> Self
pub fn enable_page_cache(self, enable_page_cache: bool) -> Self
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/
sourcepub fn enable_plugins(self, enable_plugins: bool) -> Self
👎Deprecated: Since 2.32
pub fn enable_plugins(self, enable_plugins: bool) -> Self
Determines whether or not plugins on the page are enabled.
sourcepub fn enable_private_browsing(self, enable_private_browsing: bool) -> Self
👎Deprecated: Since 2.16
pub fn enable_private_browsing(self, enable_private_browsing: bool) -> Self
Determines whether or not private browsing is enabled. Private browsing
will disable history, cache and form auto-fill for any pages visited.
Use property::WebView::is-ephemeral
or property::WebsiteDataManager::is-ephemeral
instead.
sourcepub fn enable_resizable_text_areas(
self,
enable_resizable_text_areas: bool
) -> Self
pub fn enable_resizable_text_areas(
self,
enable_resizable_text_areas: bool
) -> Self
Determines whether or not text areas can be resized.
sourcepub fn enable_site_specific_quirks(
self,
enable_site_specific_quirks: bool
) -> Self
pub fn enable_site_specific_quirks(
self,
enable_site_specific_quirks: bool
) -> Self
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.
sourcepub fn enable_smooth_scrolling(self, enable_smooth_scrolling: bool) -> Self
pub fn enable_smooth_scrolling(self, enable_smooth_scrolling: bool) -> Self
Enable or disable smooth scrolling.
Available on crate feature v2_4
only.
v2_4
only.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.
sourcepub fn enable_tabs_to_links(self, enable_tabs_to_links: bool) -> Self
pub fn enable_tabs_to_links(self, enable_tabs_to_links: bool) -> Self
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.
sourcepub fn enable_webaudio(self, enable_webaudio: bool) -> Self
pub fn enable_webaudio(self, enable_webaudio: bool) -> Self
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
sourcepub fn enable_webgl(self, enable_webgl: bool) -> Self
pub fn enable_webgl(self, enable_webgl: bool) -> Self
Enable or disable support for WebGL on pages. WebGL enables web content to use an API based on OpenGL ES 2.0.
sourcepub fn enable_webrtc(self, enable_webrtc: bool) -> Self
Available on crate feature v2_38
only.
pub fn enable_webrtc(self, enable_webrtc: bool) -> Self
v2_38
only.Enable WebRTC support for loaded pages.
Enabling this setting implies that [propertySettings
]
will be enabled as well.
See also https://www.w3.org/TR/webrtc/
sourcepub fn enable_write_console_messages_to_stdout(
self,
enable_write_console_messages_to_stdout: bool
) -> Self
Available on crate feature v2_2
only.
pub fn enable_write_console_messages_to_stdout(
self,
enable_write_console_messages_to_stdout: bool
) -> Self
v2_2
only.Enable or disable writing console messages to stdout. These are messages sent to the console with console.log and related methods.
sourcepub fn enable_xss_auditor(self, enable_xss_auditor: bool) -> Self
pub fn enable_xss_auditor(self, enable_xss_auditor: bool) -> Self
Whether to enable the XSS auditor. This feature filters some kinds of reflective XSS attacks on vulnerable web sites.
sourcepub fn fantasy_font_family(self, fantasy_font_family: &str) -> Self
pub fn fantasy_font_family(self, fantasy_font_family: &str) -> Self
The font family used as the default for content using a fantasy font.
sourcepub fn hardware_acceleration_policy(
self,
hardware_acceleration_policy: HardwareAccelerationPolicy
) -> Self
Available on crate feature v2_16
only.
pub fn hardware_acceleration_policy(
self,
hardware_acceleration_policy: HardwareAccelerationPolicy
) -> Self
v2_16
only.The HardwareAccelerationPolicy
to decide how to enable and disable
hardware acceleration. The default value HardwareAccelerationPolicy::OnDemand
enables the hardware acceleration when the web contents request it.
It’s possible to enforce hardware acceleration to be always enabled
by using HardwareAccelerationPolicy::Always
. And it’s also possible to disable it
completely using HardwareAccelerationPolicy::Never
. Note that 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.
sourcepub fn javascript_can_access_clipboard(
self,
javascript_can_access_clipboard: bool
) -> Self
pub fn javascript_can_access_clipboard(
self,
javascript_can_access_clipboard: bool
) -> Self
sourcepub fn javascript_can_open_windows_automatically(
self,
javascript_can_open_windows_automatically: bool
) -> Self
pub fn javascript_can_open_windows_automatically(
self,
javascript_can_open_windows_automatically: bool
) -> Self
Whether JavaScript can open popup windows automatically without user intervention.
sourcepub fn load_icons_ignoring_image_load_setting(
self,
load_icons_ignoring_image_load_setting: bool
) -> Self
pub fn load_icons_ignoring_image_load_setting(
self,
load_icons_ignoring_image_load_setting: bool
) -> Self
Determines whether a site can load favicons irrespective
of the value of property::Settings::auto-load-images
.
sourcepub fn media_content_types_requiring_hardware_support(
self,
media_content_types_requiring_hardware_support: &str
) -> Self
Available on crate feature v2_30
only.
pub fn media_content_types_requiring_hardware_support(
self,
media_content_types_requiring_hardware_support: &str
) -> Self
v2_30
only.List of media content types requiring hardware support, split by semicolons (:). For example: ‘video/webm; codecs=“vp*”:video/mp4; codecs=“avc*”:video/* codecs=“av1*”’.
sourcepub fn media_playback_allows_inline(
self,
media_playback_allows_inline: bool
) -> Self
pub fn media_playback_allows_inline(
self,
media_playback_allows_inline: bool
) -> Self
sourcepub fn media_playback_requires_user_gesture(
self,
media_playback_requires_user_gesture: bool
) -> Self
pub fn media_playback_requires_user_gesture(
self,
media_playback_requires_user_gesture: bool
) -> Self
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.
sourcepub fn minimum_font_size(self, minimum_font_size: u32) -> Self
pub fn minimum_font_size(self, minimum_font_size: u32) -> Self
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.
sourcepub fn monospace_font_family(self, monospace_font_family: &str) -> Self
pub fn monospace_font_family(self, monospace_font_family: &str) -> Self
The font family used as the default for content using a monospace font.
sourcepub fn pictograph_font_family(self, pictograph_font_family: &str) -> Self
pub fn pictograph_font_family(self, pictograph_font_family: &str) -> Self
The font family used as the default for content using a pictograph font.
sourcepub fn print_backgrounds(self, print_backgrounds: bool) -> Self
pub fn print_backgrounds(self, print_backgrounds: bool) -> Self
Whether background images should be drawn during printing.
sourcepub fn sans_serif_font_family(self, sans_serif_font_family: &str) -> Self
pub fn sans_serif_font_family(self, sans_serif_font_family: &str) -> Self
The font family used as the default for content using a sans-serif font.
sourcepub fn serif_font_family(self, serif_font_family: &str) -> Self
pub fn serif_font_family(self, serif_font_family: &str) -> Self
The font family used as the default for content using a serif font.
sourcepub fn user_agent(self, user_agent: &str) -> Self
pub fn user_agent(self, user_agent: &str) -> Self
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
WebkitSettingsExt::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.
sourcepub fn zoom_text_only(self, zoom_text_only: bool) -> Self
pub fn zoom_text_only(self, zoom_text_only: bool) -> Self
Whether property::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.
Trait Implementations
sourceimpl Clone for SettingsBuilder
impl Clone for SettingsBuilder
sourcefn clone(&self) -> SettingsBuilder
fn clone(&self) -> SettingsBuilder
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more