WebKit2.Settings (original) (raw)

Description [src]

class WebKit2.Settings : GObject.Object
{
  priv: WebKitSettingsPrivate*
}

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);

Constructors

Functions

Instance methods

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

WebKit2.Settings:allow-file-access-from-file-urls

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.

since: 2.10

WebKit2.Settings:allow-modal-dialogs

Determine whether it’s allowed to create and run modal dialogs from a WebKitWebView through JavaScript withwindow.showModalDialog. If it’s set toFALSE, the associated WebKitWebView won’t be able to create new modal dialogs, so not even the WebKitWebView::createsignal will be emitted.

WebKit2.Settings:allow-top-navigation-to-data-urls

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.

since: 2.28

WebKit2.Settings:allow-universal-access-from-file-urls

Whether or not JavaScript running in the context of a file scheme URLshould 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.

since: 2.14

WebKit2.Settings: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:draw-compositing-indicators

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:enable-accelerated-2d-canvas

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.

deprecated: 2.32. since: 2.2

WebKit2.Settings: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.

since: 2.20

WebKit2.Settings:enable-fullscreen

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

WebKit2.Settings: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 WebKitSettings:enable-javascript is TRUE.

since: 2.24

WebKit2.Settings: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.

since: 2.26

WebKit2.Settings:enable-media-capabilities

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.

since: 2.22

WebKit2.Settings: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.

since: 2.4

WebKit2.Settings:enable-mediasource

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

since: 2.4

WebKit2.Settings: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 HTMLviewers. 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:enable-private-browsing

Determines whether or not private browsing is enabled. Private browsing will disable history, cache and form auto-fill for any pages visited.

deprecated: 2.16.

WebKit2.Settings:enable-site-specific-quirks

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 KHTMLworkarounds. By turning on site-specific quirks, WebKit will special-case this and other cases to make some specific sites work.

WebKit2.Settings:enable-spatial-navigation

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.

since: 2.4

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

WebKit2.Settings:hardware-acceleration-policy

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.

since: 2.16

WebKit2.Settings:media-playback-allows-inline

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:media-playback-requires-user-gesture

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: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: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 usewebkit_settings_set_user_agent_with_application_details() instead.

WebKit2.Settings:zoom-text-only

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.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct WebKit2SettingsClass {
  GObjectClass parent_class;
  void (* _webkit_reserved0) (
void
  );
  void (* _webkit_reserved1) (
void
  );
  void (* _webkit_reserved2) (
void
  );
  void (* _webkit_reserved3) (
void
  );
  
}

No description available.

Class members

parent_class: GObjectClass

No description available.

_webkit_reserved0: void (* _webkit_reserved0) ( void )

No description available.

_webkit_reserved1: void (* _webkit_reserved1) ( void )

No description available.

_webkit_reserved2: void (* _webkit_reserved2) ( void )

No description available.

_webkit_reserved3: void (* _webkit_reserved3) ( void )

No description available.