public interface BrowserSettings
Modifier and Type | Method and Description |
---|---|
void |
allowJavaScriptAccessClipboard()
Allows JavaScript code on the web pages loaded in the browser to access clipboard.
|
void |
allowJavaScriptAccessCookies()
Allows JavaScript code on the web pages loaded in the browser to read/write cookies in the
cookies storage using the
document.cookie property. |
void |
allowLoadingImagesAutomatically()
Allows loading images automatically on the web pages loaded in the browser.
|
void |
allowRunningInsecureContent()
Allows running an insecure content in the browser.
|
void |
allowScriptsToCloseWindows()
Allows JavaScript code on the web pages loaded in the browser to close the browser.
|
Color |
defaultBackgroundColor()
Returns the default background color of the web pages loaded in the browser instance
associated with these settings.
|
void |
defaultBackgroundColor(Color color)
Sets the default background color of the web pages loaded in the browser instance associated
with these settings.
|
java.lang.String |
defaultEncoding()
Returns a string that represents the default text encoding.
|
void |
defaultEncoding(java.lang.String defaultEncoding)
Updates the default text encoding with the given value.
|
FontSizeInPixels |
defaultFontSize()
Returns the default font size in pixels of the web content in the browser.
|
void |
defaultFontSize(FontSizeInPixels fontSize)
Sets the default font size of the web content in the browser.
|
void |
disableImages()
Disables images displaying on the web pages loaded in the browser.
|
void |
disableJavaScript()
Disables JavaScript on the web pages loaded in the browser.
|
void |
disableLocalStorage()
Disables the local storage in the browser.
|
void |
disableOverscrollHistoryNavigation()
Disallows back/forward navigation with a left/right swipe.
|
void |
disablePlugins()
Disables all plugins on the web pages loaded in the browser.
|
void |
disableTransparentBackground()
Disables transparent background on the web pages and makes it opaque.
|
void |
disallowJavaScriptAccessClipboard()
Disallows JavaScript code on the web pages loaded in the browser to access clipboard.
|
void |
disallowJavaScriptAccessCookies()
Disallows JavaScript code on the web pages loaded in the browser to read/write cookies in the
cookies storage using the
document.cookie property. |
void |
disallowLoadingImagesAutomatically()
Disallows loading images automatically on the web pages loaded in the browser.
|
void |
disallowRunningInsecureContent()
Disallows running an insecure content in the browser.
|
void |
disallowScriptsToCloseWindows()
Disallows JavaScript code on the web pages loaded in the browser to close the browser.
|
void |
enableImages()
Enables images displaying on the web pages loaded in the browser.
|
void |
enableJavaScript()
Enables JavaScript on the web pages loaded in the browser.
|
void |
enableLocalStorage()
Enables the local storage in the browser.
|
void |
enableOverscrollHistoryNavigation()
Allows back/forward navigation with a left/right swipe.
|
void |
enablePlugins()
Enables all plugins on the web pages loaded in the browser.
|
void |
enableTransparentBackground()
Enables transparent background on the web pages.
|
void |
hideScrollbars()
Hides the scrollbars on the web pages loaded in the browser.
|
boolean |
isAllowJavaScriptAccessClipboard()
Indicates whether JavaScript code on the web pages loaded in the browser can access
clipboard.
|
boolean |
isAllowJavaScriptAccessCookies()
Indicates whether JavaScript code is allowed to read/write cookies in the browser cookies
storage.
|
boolean |
isAllowLoadingImagesAutomatically()
Indicates whether images are allowed to be loaded automatically on the web pages loaded in
the browser.
|
boolean |
isAllowRunningInsecureContent()
Indicates whether an insecure content can run in the browser.
|
boolean |
isAllowScriptsToCloseWindows()
Indicates whether JavaScript code on the web pages loaded in the browser can close the
browser.
|
boolean |
isImagesEnabled()
Indicates whether images are displayed on the web pages loaded in the browser.
|
boolean |
isJavaScriptEnabled()
Indicates whether JavaScript on the web pages loaded in the browser is enabled.
|
boolean |
isLocalStorageEnabled()
Indicates whether the local storage in the browser is enabled.
|
boolean |
isOverscrollHistoryNavigationEnabled()
Indicates whether the browser can navigate back/forward with a left/right swipe on a devices
with touch screen.
|
boolean |
isPluginsEnabled()
Indicates whether plugins are enabled on the web pages loaded in the browser.
|
boolean |
isTransparentBackgroundEnabled()
Returns
true when the transparent background on the web pages is enabled. |
boolean |
scrollbarsHidden()
Indicates whether scrollbars on a web page loaded in the browser are hidden.
|
void |
showScrollbars()
Shows the scrollbars on the web pages loaded in the browser.
|
WebRtcIpHandlingPolicy |
webRtcIpHandlingPolicy()
Returns the WebRTC IP handling policy for the browser.
|
void |
webRtcIpHandlingPolicy(WebRtcIpHandlingPolicy policy)
Updates the WebRTC IP handling policy for the browser with the given one.
|
java.lang.String defaultEncoding()
void defaultEncoding(java.lang.String defaultEncoding)
defaultEncoding
- a string that represents the new default text encodingjava.lang.IllegalArgumentException
- when defaultEncoding
is empty or blankjava.lang.IllegalStateException
- when the browser is closedColor defaultBackgroundColor()
Initially, the default background color is white.
java.lang.IllegalStateException
- when the browser is closedvoid defaultBackgroundColor(Color color)
This color will be used as a default background color when Chromium cannot identify the background color. This may happen if the page is not fully loaded, or the page does not explicitly override the default background.
If a web page is already loaded, its default background color will be updated and an asynchronous request to repaint the web page will be sent.
color
- the new default background colorjava.lang.IllegalStateException
- when the browser is closedboolean isJavaScriptEnabled()
java.lang.IllegalStateException
- when the browser is closedvoid enableJavaScript()
java.lang.IllegalStateException
- when the browser is closedvoid disableJavaScript()
java.lang.IllegalStateException
- when the browser is closedboolean isAllowLoadingImagesAutomatically()
java.lang.IllegalStateException
- when the browser is closedvoid allowLoadingImagesAutomatically()
java.lang.IllegalStateException
- when the browser is closedvoid disallowLoadingImagesAutomatically()
java.lang.IllegalStateException
- when the browser is closedboolean isImagesEnabled()
java.lang.IllegalStateException
- when the browser is closedvoid enableImages()
java.lang.IllegalStateException
- when the browser is closedvoid disableImages()
java.lang.IllegalStateException
- when the browser is closedboolean isPluginsEnabled()
java.lang.IllegalStateException
- when the browser is closedvoid enablePlugins()
java.lang.IllegalStateException
- when the browser is closedvoid disablePlugins()
java.lang.IllegalStateException
- when the browser is closedboolean isAllowScriptsToCloseWindows()
java.lang.IllegalStateException
- when the browser is closedvoid allowScriptsToCloseWindows()
java.lang.IllegalStateException
- when the browser is closedvoid disallowScriptsToCloseWindows()
java.lang.IllegalStateException
- when the browser is closedboolean isAllowJavaScriptAccessClipboard()
java.lang.IllegalStateException
- when the browser is closedvoid allowJavaScriptAccessClipboard()
java.lang.IllegalStateException
- when the browser is closedvoid disallowJavaScriptAccessClipboard()
java.lang.IllegalStateException
- when the browser is closedboolean isLocalStorageEnabled()
java.lang.IllegalStateException
- when the browser is closedvoid enableLocalStorage()
java.lang.IllegalStateException
- when the browser is closedvoid disableLocalStorage()
java.lang.IllegalStateException
- when the browser is closedboolean isAllowRunningInsecureContent()
java.lang.IllegalStateException
- when the browser is closedvoid allowRunningInsecureContent()
java.lang.IllegalStateException
- when the browser is closedvoid disallowRunningInsecureContent()
java.lang.IllegalStateException
- when the browser is closedWebRtcIpHandlingPolicy webRtcIpHandlingPolicy()
java.lang.IllegalStateException
- when the browser is closedvoid webRtcIpHandlingPolicy(WebRtcIpHandlingPolicy policy)
policy
- a new WebRTC IP handling policyjava.lang.IllegalStateException
- when the browser is closedvoid hideScrollbars()
java.lang.IllegalStateException
- when the browser is closedvoid showScrollbars()
java.lang.IllegalStateException
- when the browser is closedboolean scrollbarsHidden()
java.lang.IllegalStateException
- when the browser is closedvoid allowJavaScriptAccessCookies()
document.cookie
property.java.lang.IllegalStateException
- when the browser is closedvoid disallowJavaScriptAccessCookies()
document.cookie
property.java.lang.IllegalStateException
- when the browser is closedboolean isAllowJavaScriptAccessCookies()
document.cookie
property.
If JavaScript is not allowed to read/write cookies then document.cookie
will
return an empty string, and document.cookie='test-cookie=test'
will not change
cookies in the cookies storage.
java.lang.IllegalStateException
- when the browser is closedvoid enableTransparentBackground()
This method supports only the
OFF_SCREEN
rendering mode on
Windows and Linux, and the both rendering modes on macOS.
Throws an exception if the current rendering mode is not supported.
java.lang.IllegalStateException
- when the current browser is already closedUnsupportedRenderingModeException
- when the current rendering mode is not supportedvoid disableTransparentBackground()
This method supports only the
OFF_SCREEN
rendering mode on
Windows and Linux, and the both rendering modes on macOS.
Throws an exception if the current rendering mode is not supported.
java.lang.IllegalStateException
- when the current browser is already closedUnsupportedRenderingModeException
- when the current rendering mode is not supportedboolean isTransparentBackgroundEnabled()
true
when the transparent background on the web pages is enabled.
This method supports only the
OFF_SCREEN
rendering mode on
Windows and Linux, and the both rendering modes on macOS.
Throws an exception if the current rendering mode is not supported.
java.lang.IllegalStateException
- when the current browser is already closedUnsupportedRenderingModeException
- when the current rendering mode is not supportedboolean isOverscrollHistoryNavigationEnabled()
java.lang.IllegalStateException
- when the browser is closedvoid enableOverscrollHistoryNavigation()
java.lang.IllegalStateException
- when the browser is closedvoid disableOverscrollHistoryNavigation()
java.lang.IllegalStateException
- when the browser is closedvoid defaultFontSize(FontSizeInPixels fontSize)
Also, updates the default fixed-width font size and sets its value less by 3 than the
given fontSize
.
fontSize
- the font size to set as default. Must not be less than 9java.lang.IllegalStateException
- when the browser is closed.java.lang.IllegalArgumentException
- when the given size is less than 9FontSizeInPixels defaultFontSize()
java.lang.IllegalStateException
- when the browser is closed