Class Settings.Builder<B extends Settings.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Settings
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSettings
object.setAllowFileAccessFromFileUrls
(boolean allowFileAccessFromFileUrls) Whether file access is allowed from file URLs.setAllowModalDialogs
(boolean allowModalDialogs) Determine whether it's allowed to create and run modal dialogs from aWebKitWebView
through JavaScript with <function>window.showModalDialog</function>.setAllowTopNavigationToDataUrls
(boolean allowTopNavigationToDataUrls) Whether or not the top frame is allowed to navigate to data URLs.setAllowUniversalAccessFromFileUrls
(boolean allowUniversalAccessFromFileUrls) Whether or not JavaScript running in the context of a file scheme URL should be allowed to access content from any origin.setAutoLoadImages
(boolean autoLoadImages) Determines whether images should be automatically loaded or not.setCursiveFontFamily
(String cursiveFontFamily) The font family used as the default for content using a cursive font.setDefaultCharset
(String defaultCharset) The default text charset used when interpreting content with an unspecified charset.setDefaultFontFamily
(String defaultFontFamily) The font family to use as the default for content that does not specify a font.setDefaultFontSize
(int defaultFontSize) The default font size in pixels to use for content displayed if no font size is specified.setDefaultMonospaceFontSize
(int defaultMonospaceFontSize) The default font size in pixels to use for content displayed in monospace font if no font size is specified.setDisableWebSecurity
(boolean disableWebSecurity) Enable or disable support for Web Security on pages.setDrawCompositingIndicators
(boolean drawCompositingIndicators) Whether to draw compositing borders and repaint counters on layers drawn with accelerated compositing.setEnable2dCanvasAcceleration
(boolean enable2dCanvasAcceleration) Enable or disable 2D canvas acceleration.setEnableBackForwardNavigationGestures
(boolean enableBackForwardNavigationGestures) Enable or disable horizontal swipe gesture for back-forward navigation.setEnableCaretBrowsing
(boolean enableCaretBrowsing) Whether to enable accessibility enhanced keyboard navigation.setEnableDeveloperExtras
(boolean enableDeveloperExtras) Determines whether or not developer tools, such as the Web Inspector, are enabled.setEnableDnsPrefetching
(boolean enableDnsPrefetching) Determines whether or not to prefetch domain names.setEnableEncryptedMedia
(boolean enableEncryptedMedia) Enable or disable support for Encrypted Media API on pages.setEnableFullscreen
(boolean enableFullscreen) Whether to enable the Javascript Fullscreen API.setEnableHtml5Database
(boolean enableHtml5Database) Whether to enable HTML5 client-side SQL database support (IndexedDB).setEnableHtml5LocalStorage
(boolean enableHtml5LocalStorage) Whether to enable HTML5 local storage support.setEnableHyperlinkAuditing
(boolean enableHyperlinkAuditing) Determines whether or not hyperlink auditing is enabled.setEnableJavascript
(boolean enableJavascript) Determines whether or not JavaScript executes within a page.setEnableJavascriptMarkup
(boolean enableJavascriptMarkup) Determines whether or not JavaScript markup is allowed in document.setEnableMedia
(boolean enableMedia) Enable or disable support for media playback on pages.setEnableMediaCapabilities
(boolean enableMediaCapabilities) Enable or disable support for MediaCapabilities on pages.setEnableMediasource
(boolean enableMediasource) Enable or disable support for MediaSource on pages.setEnableMediaStream
(boolean enableMediaStream) Enable or disable support for MediaStream on pages.setEnableMockCaptureDevices
(boolean enableMockCaptureDevices) Enable or disable the Mock Capture Devices.setEnableOfflineWebApplicationCache
(boolean enableOfflineWebApplicationCache) Deprecated.setEnablePageCache
(boolean enablePageCache) Enable or disable the page cache.setEnableResizableTextAreas
(boolean enableResizableTextAreas) Determines whether or not text areas can be resized.setEnableSiteSpecificQuirks
(boolean enableSiteSpecificQuirks) Whether to turn on site-specific quirks.setEnableSmoothScrolling
(boolean enableSmoothScrolling) Enable or disable smooth scrolling.setEnableSpatialNavigation
(boolean enableSpatialNavigation) Whether to enable Spatial Navigation.setEnableTabsToLinks
(boolean enableTabsToLinks) Determines whether the tab key cycles through the elements on the page.setEnableWebaudio
(boolean enableWebaudio) Enable or disable support for WebAudio on pages.setEnableWebgl
(boolean enableWebgl) Enable or disable support for WebGL on pages.setEnableWebrtc
(boolean enableWebrtc) Enable WebRTC support for loaded pages.setEnableWriteConsoleMessagesToStdout
(boolean enableWriteConsoleMessagesToStdout) Enable or disable writing console messages to stdout.setFantasyFontFamily
(String fantasyFontFamily) The font family used as the default for content using a fantasy font.setHardwareAccelerationPolicy
(HardwareAccelerationPolicy hardwareAccelerationPolicy) TheWebKitHardwareAccelerationPolicy
to decide how to enable and disable hardware acceleration.setJavascriptCanAccessClipboard
(boolean javascriptCanAccessClipboard) Whether JavaScript can access the clipboard.setJavascriptCanOpenWindowsAutomatically
(boolean javascriptCanOpenWindowsAutomatically) Whether JavaScript can open popup windows automatically without user intervention.setLoadIconsIgnoringImageLoadSetting
(boolean loadIconsIgnoringImageLoadSetting) Deprecated.setMediaContentTypesRequiringHardwareSupport
(String mediaContentTypesRequiringHardwareSupport) List of media content types requiring hardware support, split by semicolons (:).setMediaPlaybackAllowsInline
(boolean mediaPlaybackAllowsInline) Whether media playback is full-screen only or inline playback is allowed.setMediaPlaybackRequiresUserGesture
(boolean mediaPlaybackRequiresUserGesture) Whether a user gesture (such as clicking the play button) would be required to start media playback or load media.setMinimumFontSize
(int minimumFontSize) The minimum font size in pixels used to display text.setMonospaceFontFamily
(String monospaceFontFamily) The font family used as the default for content using a monospace font.setPictographFontFamily
(String pictographFontFamily) The font family used as the default for content using a pictograph font.setPrintBackgrounds
(boolean printBackgrounds) Whether background images should be drawn during printing.setSansSerifFontFamily
(String sansSerifFontFamily) The font family used as the default for content using a sans-serif font.setSerifFontFamily
(String serifFontFamily) The font family used as the default for content using a serif font.setUserAgent
(String userAgent) The user-agent string used by WebKit.setZoomTextOnly
(boolean zoomTextOnly) WhetherWebKitWebView
:zoom-level affects only the text of the page or all the contents.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theSettings
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toSettings
.- Overrides:
build
in classGObject.Builder<B extends Settings.Builder<B>>
- Returns:
- a new instance of
Settings
with the properties that were set in the Builder object. - Throws:
UnsupportedPlatformException
- when run on an unsupported platform
-
setAllowFileAccessFromFileUrls
Whether file access is allowed from file URLs. By default, when something is loaded in aWebKitWebView
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.- Parameters:
allowFileAccessFromFileUrls
- the value for theallow-file-access-from-file-urls
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setAllowModalDialogs
Determine whether it's allowed to create and run modal dialogs from aWebKitWebView
through JavaScript with <function>window.showModalDialog</function>. If it's set tofalse
, the associatedWebKitWebView
won't be able to create new modal dialogs, so not even theWebKitWebView
::create signal will be emitted.- Parameters:
allowModalDialogs
- the value for theallow-modal-dialogs
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setAllowUniversalAccessFromFileUrls
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 aWebKitWebView
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.- Parameters:
allowUniversalAccessFromFileUrls
- the value for theallow-universal-access-from-file-urls
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setAutoLoadImages
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.- Parameters:
autoLoadImages
- the value for theauto-load-images
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setCursiveFontFamily
-
setDefaultCharset
-
setDefaultFontFamily
-
setDefaultFontSize
The default font size in pixels to use for content displayed if no font size is specified.- Parameters:
defaultFontSize
- the value for thedefault-font-size
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDefaultMonospaceFontSize
The default font size in pixels to use for content displayed in monospace font if no font size is specified.- Parameters:
defaultMonospaceFontSize
- the value for thedefault-monospace-font-size
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDisableWebSecurity
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.
- Parameters:
disableWebSecurity
- the value for thedisable-web-security
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDrawCompositingIndicators
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.- Parameters:
drawCompositingIndicators
- the value for thedraw-compositing-indicators
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnable2dCanvasAcceleration
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.- Parameters:
enable2dCanvasAcceleration
- the value for theenable-2d-canvas-acceleration
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableCaretBrowsing
Whether to enable accessibility enhanced keyboard navigation.- Parameters:
enableCaretBrowsing
- the value for theenable-caret-browsing
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableDeveloperExtras
Determines whether or not developer tools, such as the Web Inspector, are enabled.- Parameters:
enableDeveloperExtras
- the value for theenable-developer-extras
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableDnsPrefetching
Determines whether or not to prefetch domain names. DNS prefetching attempts to resolve domain names before a user tries to follow a link.- Parameters:
enableDnsPrefetching
- the value for theenable-dns-prefetching
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableEncryptedMedia
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/
- Parameters:
enableEncryptedMedia
- the value for theenable-encrypted-media
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableFullscreen
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/- Parameters:
enableFullscreen
- the value for theenable-fullscreen
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableHtml5Database
Whether to enable HTML5 client-side SQL database support (IndexedDB).- Parameters:
enableHtml5Database
- the value for theenable-html5-database
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableHtml5LocalStorage
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/.
- Parameters:
enableHtml5LocalStorage
- the value for theenable-html5-local-storage
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableHyperlinkAuditing
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.- Parameters:
enableHyperlinkAuditing
- the value for theenable-hyperlink-auditing
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableJavascript
Determines whether or not JavaScript executes within a page.- Parameters:
enableJavascript
- the value for theenable-javascript
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableJavascriptMarkup
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 ifWebKitSettings
:enable-javascript istrue
.- Parameters:
enableJavascriptMarkup
- the value for theenable-javascript-markup
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableMedia
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.- Parameters:
enableMedia
- the value for theenable-media
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableMediaCapabilities
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/
- Parameters:
enableMediaCapabilities
- the value for theenable-media-capabilities
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableMediaStream
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
- Parameters:
enableMediaStream
- the value for theenable-media-stream
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableMediasource
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/
- Parameters:
enableMediasource
- the value for theenable-mediasource
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableMockCaptureDevices
Enable or disable the Mock Capture Devices. Those are fake Microphone and Camera devices to be used as MediaStream sources.- Parameters:
enableMockCaptureDevices
- the value for theenable-mock-capture-devices
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableOfflineWebApplicationCache
Deprecated.Unsupported setting. This property does nothing.- Parameters:
enableOfflineWebApplicationCache
- the value for theenable-offline-web-application-cache
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnablePageCache
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/- Parameters:
enablePageCache
- the value for theenable-page-cache
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableResizableTextAreas
Determines whether or not text areas can be resized.- Parameters:
enableResizableTextAreas
- the value for theenable-resizable-text-areas
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableSiteSpecificQuirks
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.- Parameters:
enableSiteSpecificQuirks
- the value for theenable-site-specific-quirks
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableSmoothScrolling
Enable or disable smooth scrolling.- Parameters:
enableSmoothScrolling
- the value for theenable-smooth-scrolling
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableTabsToLinks
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.- Parameters:
enableTabsToLinks
- the value for theenable-tabs-to-links
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableWebaudio
Enable or disable support for WebAudio on pages. WebAudio is an API for processing and synthesizing audio in web applicationsSee also https://webaudio.github.io/web-audio-api
- Parameters:
enableWebaudio
- the value for theenable-webaudio
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableWebgl
Enable or disable support for WebGL on pages. WebGL enables web content to use an API based on OpenGL ES 2.0.- Parameters:
enableWebgl
- the value for theenable-webgl
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableWebrtc
Enable WebRTC support for loaded pages.Enabling this setting implies that
Settings:enable-media-stream
will be enabled as well.See also https://www.w3.org/TR/webrtc/
- Parameters:
enableWebrtc
- the value for theenable-webrtc
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableWriteConsoleMessagesToStdout
Enable or disable writing console messages to stdout. These are messages sent to the console with console.log and related methods.- Parameters:
enableWriteConsoleMessagesToStdout
- the value for theenable-write-console-messages-to-stdout
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setFantasyFontFamily
-
setHardwareAccelerationPolicy
TheWebKitHardwareAccelerationPolicy
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.
- Parameters:
hardwareAccelerationPolicy
- the value for thehardware-acceleration-policy
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setJavascriptCanAccessClipboard
Whether JavaScript can access the clipboard. The default value isfalse
. If set totrue
, document.execCommand() allows cut, copy and paste commands.- Parameters:
javascriptCanAccessClipboard
- the value for thejavascript-can-access-clipboard
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setJavascriptCanOpenWindowsAutomatically
Whether JavaScript can open popup windows automatically without user intervention.- Parameters:
javascriptCanOpenWindowsAutomatically
- the value for thejavascript-can-open-windows-automatically
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setLoadIconsIgnoringImageLoadSetting
@Deprecated public B setLoadIconsIgnoringImageLoadSetting(boolean loadIconsIgnoringImageLoadSetting) Deprecated.Unsupported setting. This property does nothing.- Parameters:
loadIconsIgnoringImageLoadSetting
- the value for theload-icons-ignoring-image-load-setting
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMediaContentTypesRequiringHardwareSupport
public B setMediaContentTypesRequiringHardwareSupport(String mediaContentTypesRequiringHardwareSupport) List of media content types requiring hardware support, split by semicolons (:). For example: 'video/webm; codecs="vp*":video/mp4; codecs="avc*":video/* codecs="av1*"'.- Parameters:
mediaContentTypesRequiringHardwareSupport
- the value for themedia-content-types-requiring-hardware-support
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMediaPlaybackAllowsInline
Whether media playback is full-screen only or inline playback is allowed. This istrue
by default, so media playback can be inline. Setting it tofalse
allows specifying that media playback should be always fullscreen.- Parameters:
mediaPlaybackAllowsInline
- the value for themedia-playback-allows-inline
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMediaPlaybackRequiresUserGesture
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.- Parameters:
mediaPlaybackRequiresUserGesture
- the value for themedia-playback-requires-user-gesture
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMinimumFontSize
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.- Parameters:
minimumFontSize
- the value for theminimum-font-size
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMonospaceFontFamily
-
setPictographFontFamily
-
setPrintBackgrounds
Whether background images should be drawn during printing.- Parameters:
printBackgrounds
- the value for theprint-backgrounds
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSansSerifFontFamily
-
setSerifFontFamily
-
setUserAgent
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
null
, it will revert to the standard user-agent.- Parameters:
userAgent
- the value for theuser-agent
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setZoomTextOnly
WhetherWebKitWebView
: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.- Parameters:
zoomTextOnly
- the value for thezoom-text-only
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-