Settings

class Settings(pointer: <Error class: unknown class><<Error class: unknown class>>)

Control the behaviour of a #WebKitWebView.

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

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

Skipped during bindings generation

  • method media-content-types-requiring-hardware-support: Property TypeInfo of getter and setter do not match

  • method user-agent: Property TypeInfo of getter and setter do not match

  • constructor new_with_settings: Varargs parameter is not supported

Constructors

Link copied to clipboard
constructor()

Creates a new #WebKitSettings instance with default values.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether file access is allowed from file URLs. By default, when something is loaded in a #WebKitWebView 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.

Link copied to clipboard

Determine whether it's allowed to create and run modal dialogs from a #WebKitWebView through JavaScript with window.showModalDialog. If it's set to false, the associated #WebKitWebView won't be able to create new modal dialogs, so not even the #WebKitWebView::create signal will be emitted.

Link copied to clipboard

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.

Link copied to clipboard

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 #WebKitWebView 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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
var defaultFontSize: <Error class: unknown class>

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

Link copied to clipboard
var defaultMonospaceFontSize: <Error class: unknown class>

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

Link copied to clipboard

Enable or disable support for Web Security on pages.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Whether to enable accessibility enhanced keyboard navigation.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

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/

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Determines whether or not hyperlink auditing is enabled.

Link copied to clipboard

Determines whether or not JavaScript executes within a page.

Link copied to clipboard

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 #WebKitSettings:enable-javascript is true.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Unsupported setting. This property does nothing.

Link copied to clipboard

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/

Link copied to clipboard

Determines whether or not text areas can be resized.

Link copied to clipboard

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.

Link copied to clipboard

Enable or disable smooth scrolling.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Enable WebRTC support for loaded pages.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Whether JavaScript can open popup windows automatically without user intervention.

Link copied to clipboard

Unsupported setting. This property does nothing.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard
var minimumFontSize: <Error class: unknown class>

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Whether background images should be drawn during printing.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
val webkitSettingsPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether #WebKitWebView: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.

Functions

Link copied to clipboard
fun applyFromKeyFile(keyFile: <Error class: unknown class>, groupName: String): <Error class: unknown class><Boolean>

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

Link copied to clipboard

Gets whether a feature is enabled.

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

Link copied to clipboard

Get the #WebKitSettings:user-agent property.

Link copied to clipboard
fun setFeatureEnabled(feature: Feature, enabled: Boolean)

Enables or disables a feature.

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

Link copied to clipboard
fun setUserAgent(userAgent: String? = null)

Set the #WebKitSettings:user-agent property.

Link copied to clipboard
fun setUserAgentWithApplicationDetails(applicationName: String? = null, applicationVersion: String? = null)

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