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.
|
Browser |
browser()
Returns the
Browser instance configured by this settings. |
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.
|
Browser browser()
Browser
instance configured by this settings.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 blankObjectClosedException
- when the browser is closedColor defaultBackgroundColor()
Initially, the default background color is white.
ObjectClosedException
- 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 colorObjectClosedException
- when the browser is closedboolean isJavaScriptEnabled()
ObjectClosedException
- when the browser is closedvoid enableJavaScript()
ObjectClosedException
- when the browser is closedvoid disableJavaScript()
ObjectClosedException
- when the browser is closedboolean isAllowLoadingImagesAutomatically()
ObjectClosedException
- when the browser is closedvoid allowLoadingImagesAutomatically()
ObjectClosedException
- when the browser is closedvoid disallowLoadingImagesAutomatically()
ObjectClosedException
- when the browser is closedboolean isImagesEnabled()
ObjectClosedException
- when the browser is closedvoid enableImages()
ObjectClosedException
- when the browser is closedvoid disableImages()
ObjectClosedException
- when the browser is closedboolean isPluginsEnabled()
ObjectClosedException
- when the browser is closedvoid enablePlugins()
ObjectClosedException
- when the browser is closedvoid disablePlugins()
ObjectClosedException
- when the browser is closedboolean isAllowScriptsToCloseWindows()
ObjectClosedException
- when the browser is closedvoid allowScriptsToCloseWindows()
ObjectClosedException
- when the browser is closedvoid disallowScriptsToCloseWindows()
ObjectClosedException
- when the browser is closedboolean isAllowJavaScriptAccessClipboard()
ObjectClosedException
- when the browser is closedvoid allowJavaScriptAccessClipboard()
ObjectClosedException
- when the browser is closedvoid disallowJavaScriptAccessClipboard()
ObjectClosedException
- when the browser is closedboolean isLocalStorageEnabled()
ObjectClosedException
- when the browser is closedvoid enableLocalStorage()
ObjectClosedException
- when the browser is closedvoid disableLocalStorage()
ObjectClosedException
- when the browser is closedboolean isAllowRunningInsecureContent()
ObjectClosedException
- when the browser is closedvoid allowRunningInsecureContent()
ObjectClosedException
- when the browser is closedvoid disallowRunningInsecureContent()
ObjectClosedException
- when the browser is closedWebRtcIpHandlingPolicy webRtcIpHandlingPolicy()
ObjectClosedException
- when the browser is closedvoid webRtcIpHandlingPolicy(WebRtcIpHandlingPolicy policy)
policy
- a new WebRTC IP handling policyObjectClosedException
- when the browser is closedvoid hideScrollbars()
ObjectClosedException
- when the browser is closedvoid showScrollbars()
ObjectClosedException
- when the browser is closedboolean scrollbarsHidden()
ObjectClosedException
- when the browser is closedvoid allowJavaScriptAccessCookies()
document.cookie
property.ObjectClosedException
- when the browser is closedvoid disallowJavaScriptAccessCookies()
document.cookie
property.ObjectClosedException
- 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.
ObjectClosedException
- 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.
ObjectClosedException
- 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.
ObjectClosedException
- 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.
ObjectClosedException
- when the current browser is already closedUnsupportedRenderingModeException
- when the current rendering mode is not supportedboolean isOverscrollHistoryNavigationEnabled()
ObjectClosedException
- when the browser is closedvoid enableOverscrollHistoryNavigation()
ObjectClosedException
- when the browser is closedvoid disableOverscrollHistoryNavigation()
ObjectClosedException
- 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 9ObjectClosedException
- when the browser is closed.java.lang.IllegalArgumentException
- when the given size is less than 9FontSizeInPixels defaultFontSize()
ObjectClosedException
- when the browser is closed