Class WebClientOptions
- java.lang.Object
-
- org.htmlunit.WebClientOptions
-
- All Implemented Interfaces:
java.io.Serializable
public class WebClientOptions extends java.lang.Object implements java.io.Serializable
Represents options of aWebClient
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebClientOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
getConnectionTimeToLive()
Gets the connTimeToLive value for the HttpClient connection pool.int
getHistoryPageCacheLimit()
Returns the maximum number ofpages
to cache in history.int
getHistorySizeLimit()
Returns the maximum number ofpages
kept inWebWindow.getHistory()
.java.lang.String
getHomePage()
Returns the client's current homepage.java.net.InetAddress
getLocalAddress()
Returns local address to be used for request execution.int
getMaxInMemory()
Returns the maximum bytes to have in memory, after which the content is saved to a temporary file.ProxyConfig
getProxyConfig()
Returns the proxy configuration for this client.int
getScreenHeight()
Returns the screen height.int
getScreenWidth()
Returns the screen width.char[]
getSSLClientCertificatePassword()
Gets the SSLClientCertificatePassword.java.security.KeyStore
getSSLClientCertificateStore()
Gets the SSLClientCertificateStore.java.lang.String[]
getSSLClientCipherSuites()
Gets the cipher suites enabled for use on SSL connections.java.lang.String[]
getSSLClientProtocols()
Gets the protocol versions enabled for use on SSL connections.java.lang.String
getSSLInsecureProtocol()
Gets the SSL protocol, to be used only whensetUseInsecureSSL(boolean)
is set totrue
.java.security.KeyStore
getSSLTrustStore()
Gets the SSL TrustStore.java.io.File
getTempFileDirectory()
Returns the directory to be used for storing the response content in a temporary file seegetMaxInMemory()
.int
getTimeout()
Gets the timeout value for theWebConnection
.int
getWebSocketMaxBinaryMessageBufferSize()
int
getWebSocketMaxBinaryMessageSize()
int
getWebSocketMaxTextMessageBufferSize()
int
getWebSocketMaxTextMessageSize()
boolean
isActiveXNative()
Deprecated.as of version 3.4.0boolean
isAppletEnabled()
Returnstrue
if Applet are enabled.boolean
isCssEnabled()
Returnstrue
if CSS is enabled.boolean
isDoNotTrackEnabled()
Returnstrue
if "Do Not Track" is enabled.boolean
isDownloadImages()
Returns whether to automatically download images by default, or not.boolean
isFetchPolyfillEnabled()
boolean
isGeolocationEnabled()
Returnstrue
if Geolocation is enabled.boolean
isJavaScriptEnabled()
Returnstrue
if JavaScript is enabled and the script engine was loaded successfully.boolean
isPopupBlockerEnabled()
Returnstrue
if the popup window blocker is enabled.boolean
isPrintContentOnFailingStatusCode()
Returnstrue
if the content of the resulting document will be printed to the console in the event of a failing response code.boolean
isRedirectEnabled()
Returns whether or not redirections will be followed automatically on receipt of a redirect status code from the server.boolean
isThrowExceptionOnFailingStatusCode()
Returnstrue
if an exception will be thrown in the event of a failing response code.boolean
isThrowExceptionOnScriptError()
Indicates if an exception should be thrown when a script execution fails (the default) or if it should be caught and just logged to allow page execution to continue.boolean
isUseInsecureSSL()
Indicates if insecure SSL should be used.boolean
isWebSocketEnabled()
Returnstrue
if WebSockets are enabled.void
setActiveXNative(boolean allow)
Deprecated.as of version 3.4.0void
setAppletEnabled(boolean enabled)
Enables/disables Applet support.void
setConnectionTimeToLive(long connectionTimeToLive)
Sets the connTimeToLive of the HttpClient connection pool.void
setCssEnabled(boolean enabled)
Enables/disables CSS support.void
setDoNotTrackEnabled(boolean enabled)
Enables/disables "Do Not Track" support.void
setDownloadImages(boolean downloadImages)
Sets whether to automatically download images by default, or not.void
setFetchPolyfillEnabled(boolean enabled)
Sets whether or not fetch polyfill should be used.void
setGeolocationEnabled(boolean enabled)
Enables/disables Geolocation support.void
setHistoryPageCacheLimit(int historyPageCacheLimit)
Sets the maximum number ofpages
to cache in history.void
setHistorySizeLimit(int historySizeLimit)
Sets the History size limit.void
setHomePage(java.lang.String homePage)
Sets the client's homepage.void
setJavaScriptEnabled(boolean enabled)
Enables/disables JavaScript support.void
setLocalAddress(java.net.InetAddress localAddress)
Sets the local address to be used for request execution.void
setMaxInMemory(int maxInMemory)
Sets the maximum bytes to have in memory, after which the content is saved to a temporary file.void
setPopupBlockerEnabled(boolean enabled)
Enable/disable the popup window blocker.void
setPrintContentOnFailingStatusCode(boolean enabled)
Specify whether or not the content of the resulting document will be printed to the console in the event of a failing response code.void
setProxyConfig(ProxyConfig proxyConfig)
Sets the proxy configuration for this client.void
setRedirectEnabled(boolean enabled)
Sets whether or not redirections will be followed automatically on receipt of a redirect status code from the server.void
setScreenHeight(int screenHeight)
Sets the screen height.void
setScreenWidth(int screenWidth)
Sets the screen width.void
setSSLClientCertificate(java.io.InputStream certificateInputStream, java.lang.String certificatePassword, java.lang.String certificateType)
Deprecated.as of version 3.10.0; usesetSSLClientCertificateKeyStore(InputStream, String, String)
insteadvoid
setSSLClientCertificate(java.net.URL certificateUrl, java.lang.String certificatePassword, java.lang.String certificateType)
Deprecated.as of version 3.10.0; usesetSSLClientCertificateKeyStore(URL, String, String)
insteadvoid
setSSLClientCertificateKeyStore(java.io.InputStream keyStoreInputStream, java.lang.String keyStorePassword, java.lang.String keyStoreType)
Sets the SSL client certificateKeyStore
to use.void
setSSLClientCertificateKeyStore(java.net.URL keyStoreUrl, java.lang.String keyStorePassword, java.lang.String keyStoreType)
Sets the SSL client certificate to use.void
setSSLClientCertificateKeyStore(java.security.KeyStore keyStore, char[] keyStorePassword)
Sets the SSL client certificateKeyStore
to use.void
setSSLClientCipherSuites(java.lang.String... sslClientCipherSuites)
Sets the cipher suites enabled for use on SSL connections,null
to use default ones.void
setSSLClientProtocols(java.lang.String... sslClientProtocols)
Sets the protocol versions enabled for use on SSL connections,null
to use default ones.void
setSSLInsecureProtocol(java.lang.String sslInsecureProtocol)
Sets the SSL protocol, used only whensetUseInsecureSSL(boolean)
is set totrue
.void
setSSLTrustStore(java.net.URL sslTrustStoreUrl, java.lang.String sslTrustStorePassword, java.lang.String sslTrustStoreType)
Sets the SSL server certificate trust store.void
setSSLTrustStore(java.security.KeyStore keyStore)
void
setTempFileDirectory(java.io.File tempFileDirectory)
Sets the directory to be used for storing the response content in a temporary file seesetMaxInMemory(int)
.void
setThrowExceptionOnFailingStatusCode(boolean enabled)
Specify whether or not an exception will be thrown in the event of a failing status code.void
setThrowExceptionOnScriptError(boolean enabled)
Changes the behavior of this webclient when a script error occurs.void
setTimeout(int timeout)
Sets the timeout of theWebConnection
.void
setUseInsecureSSL(boolean useInsecureSSL)
If set totrue
, the client will accept connections to any host, regardless of whether they have valid certificates or not.void
setWebSocketEnabled(boolean enabled)
Enables/disables WebSocket support.void
setWebSocketMaxBinaryMessageBufferSize(int webSocketMaxBinaryMessageBufferSize)
Sets the WebSocket maxBinaryMessageBufferSize.void
setWebSocketMaxBinaryMessageSize(int webSocketMaxBinaryMessageSize)
Sets the WebSocket maxBinaryMessageSize.void
setWebSocketMaxTextMessageBufferSize(int webSocketMaxTextMessageBufferSize)
Sets the WebSocket maxTextMessageBufferSize.void
setWebSocketMaxTextMessageSize(int webSocketMaxTextMessageSize)
Sets the WebSocket maxTextMessageSize.
-
-
-
Method Detail
-
setUseInsecureSSL
public void setUseInsecureSSL(boolean useInsecureSSL)
If set totrue
, the client will accept connections to any host, regardless of whether they have valid certificates or not. This is especially useful when you are trying to connect to a server with expired or corrupt certificates.- Parameters:
useInsecureSSL
- whether or not to use insecure SSL
-
isUseInsecureSSL
public boolean isUseInsecureSSL()
Indicates if insecure SSL should be used.- Returns:
true
if insecure SSL should be used. Default isfalse
.
-
setRedirectEnabled
public void setRedirectEnabled(boolean enabled)
Sets whether or not redirections will be followed automatically on receipt of a redirect status code from the server.- Parameters:
enabled
- true to enable automatic redirection
-
getTempFileDirectory
public java.io.File getTempFileDirectory()
Returns the directory to be used for storing the response content in a temporary file seegetMaxInMemory()
.- Returns:
- the directory to be used for storing temp files or null to use the system default
-
setTempFileDirectory
public void setTempFileDirectory(java.io.File tempFileDirectory) throws java.io.IOException
Sets the directory to be used for storing the response content in a temporary file seesetMaxInMemory(int)
. If the given directory does not exist, this creates it.- Parameters:
tempFileDirectory
- the directory to be used or null to use the system default- Throws:
java.io.IOException
- in case of error
-
isRedirectEnabled
public boolean isRedirectEnabled()
Returns whether or not redirections will be followed automatically on receipt of a redirect status code from the server.- Returns:
- true if automatic redirection is enabled
-
setSSLClientCertificateKeyStore
public void setSSLClientCertificateKeyStore(java.security.KeyStore keyStore, char[] keyStorePassword)
Sets the SSL client certificateKeyStore
to use.If the web server requires Renegotiation, you have to set system property "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in TLS Renegotiation Issue.
In some cases the impl seems to pick old certificates from the
KeyStore
. To avoid that, wrap yourKeyStore
inside your ownKeyStore
impl and filter out outdated certificates.- Parameters:
keyStore
-KeyStore
to usekeyStorePassword
- the keystore password
-
setSSLClientCertificate
@Deprecated public void setSSLClientCertificate(java.net.URL certificateUrl, java.lang.String certificatePassword, java.lang.String certificateType)
Deprecated.as of version 3.10.0; usesetSSLClientCertificateKeyStore(URL, String, String)
insteadSets the SSL client certificate to use. The needed parameters are used to construct aKeyStore
.If the web server requires Renegotiation, you have to set system property "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in TLS Renegotiation Issue.
- Parameters:
certificateUrl
- the URL which locates the certificatecertificatePassword
- the certificate passwordcertificateType
- the type of certificate, usuallyjks
orpkcs12
-
setSSLClientCertificateKeyStore
public void setSSLClientCertificateKeyStore(java.net.URL keyStoreUrl, java.lang.String keyStorePassword, java.lang.String keyStoreType)
Sets the SSL client certificate to use. The needed parameters are used to construct aKeyStore
.If the web server requires Renegotiation, you have to set system property "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in TLS Renegotiation Issue.
- Parameters:
keyStoreUrl
- the URL which locates the certificateKeyStore
keyStorePassword
- the certificateKeyStore
passwordkeyStoreType
- the type of certificateKeyStore
, usuallyjks
orpkcs12
-
setSSLClientCertificate
@Deprecated public void setSSLClientCertificate(java.io.InputStream certificateInputStream, java.lang.String certificatePassword, java.lang.String certificateType)
Deprecated.as of version 3.10.0; usesetSSLClientCertificateKeyStore(InputStream, String, String)
insteadSets the SSL client certificate to use. The needed parameters are used to construct aKeyStore
.If the web server requires Renegotiation, you have to set system property "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in TLS Renegotiation Issue.
In some cases the impl seems to pick old certificats from the KeyStore. To avoid that, wrap your keystore inside your own KeyStore impl and filter out outdated certificates. Provide the Keystore to the options instead of the input stream.
- Parameters:
certificateInputStream
- the input stream which represents the certificatecertificatePassword
- the certificate passwordcertificateType
- the type of certificate, usuallyjks
orpkcs12
-
setSSLClientCertificateKeyStore
public void setSSLClientCertificateKeyStore(java.io.InputStream keyStoreInputStream, java.lang.String keyStorePassword, java.lang.String keyStoreType)
Sets the SSL client certificateKeyStore
to use. The parameters are used to construct theKeyStore
.If the web server requires Renegotiation, you have to set system property "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in TLS Renegotiation Issue.
In some cases the impl seems to pick old certificates from the
KeyStore
. To avoid that, wrap yourKeyStore
inside your ownKeyStore
impl and filter out outdated certificates. Provide theKeyStore
to the options instead of the input stream.- Parameters:
keyStoreInputStream
- the input stream which represents theKeyStore
holding the certificateskeyStorePassword
- theKeyStore
passwordkeyStoreType
- the type ofKeyStore
, usuallyjks
orpkcs12
-
getSSLClientCertificateStore
public java.security.KeyStore getSSLClientCertificateStore()
Gets the SSLClientCertificateStore.- Returns:
- the KeyStore for use on SSL connections
-
getSSLClientCertificatePassword
public char[] getSSLClientCertificatePassword()
Gets the SSLClientCertificatePassword.- Returns:
- the password
-
getSSLClientProtocols
public java.lang.String[] getSSLClientProtocols()
Gets the protocol versions enabled for use on SSL connections.- Returns:
- the protocol versions enabled for use on SSL connections
- See Also:
setSSLClientProtocols(String...)
-
setSSLClientProtocols
public void setSSLClientProtocols(java.lang.String... sslClientProtocols)
Sets the protocol versions enabled for use on SSL connections,null
to use default ones.- Parameters:
sslClientProtocols
- the protocol versions- See Also:
SSLSocket.setEnabledProtocols(String[])
,getSSLClientProtocols()
-
getSSLClientCipherSuites
public java.lang.String[] getSSLClientCipherSuites()
Gets the cipher suites enabled for use on SSL connections.- Returns:
- the cipher suites enabled for use on SSL connections
- See Also:
setSSLClientCipherSuites(String...)
-
setSSLClientCipherSuites
public void setSSLClientCipherSuites(java.lang.String... sslClientCipherSuites)
Sets the cipher suites enabled for use on SSL connections,null
to use default ones.- Parameters:
sslClientCipherSuites
- the cipher suites- See Also:
SSLSocket.setEnabledCipherSuites(String[])
,getSSLClientCipherSuites()
-
setJavaScriptEnabled
public void setJavaScriptEnabled(boolean enabled)
Enables/disables JavaScript support. By default, this property is enabled.- Parameters:
enabled
-true
to enable JavaScript support
-
isJavaScriptEnabled
public boolean isJavaScriptEnabled()
Returnstrue
if JavaScript is enabled and the script engine was loaded successfully.- Returns:
true
if JavaScript is enabled
-
setCssEnabled
public void setCssEnabled(boolean enabled)
Enables/disables CSS support. By default, this property is enabled. If disabled HtmlUnit will not download the linked css files and also not triggered the associated onload/onerror events.- Parameters:
enabled
-true
to enable CSS support
-
isCssEnabled
public boolean isCssEnabled()
Returnstrue
if CSS is enabled.- Returns:
true
if CSS is enabled
-
setAppletEnabled
public void setAppletEnabled(boolean enabled)
Enables/disables Applet support. By default, this property is disabled.
Note: Applet support is experimental and minimal
- Parameters:
enabled
-true
to enable Applet support
-
isAppletEnabled
public boolean isAppletEnabled()
Returnstrue
if Applet are enabled.- Returns:
true
if Applet is enabled
-
setPopupBlockerEnabled
public void setPopupBlockerEnabled(boolean enabled)
Enable/disable the popup window blocker. By default, the popup blocker is disabled, and popup windows are allowed. When set totrue
,window.open()
has no effect and returnsnull
.- Parameters:
enabled
-true
to enable the popup window blocker
-
isPopupBlockerEnabled
public boolean isPopupBlockerEnabled()
Returnstrue
if the popup window blocker is enabled.- Returns:
true
if the popup window blocker is enabled
-
setGeolocationEnabled
public void setGeolocationEnabled(boolean enabled)
Enables/disables Geolocation support. By default, this property is disabled.- Parameters:
enabled
-true
to enable Geolocation support
-
isGeolocationEnabled
public boolean isGeolocationEnabled()
Returnstrue
if Geolocation is enabled.- Returns:
true
if Geolocation is enabled
-
setDoNotTrackEnabled
public void setDoNotTrackEnabled(boolean enabled)
Enables/disables "Do Not Track" support. By default, this property is disabled.- Parameters:
enabled
-true
to enable "Do Not Track" support
-
isDoNotTrackEnabled
public boolean isDoNotTrackEnabled()
Returnstrue
if "Do Not Track" is enabled.- Returns:
true
if "Do Not Track" is enabled
-
setPrintContentOnFailingStatusCode
public void setPrintContentOnFailingStatusCode(boolean enabled)
Specify whether or not the content of the resulting document will be printed to the console in the event of a failing response code. Successful response codes are in the range 200-299. The default is true.- Parameters:
enabled
- True to enable this feature
-
isPrintContentOnFailingStatusCode
public boolean isPrintContentOnFailingStatusCode()
Returnstrue
if the content of the resulting document will be printed to the console in the event of a failing response code.- Returns:
true
if the content of the resulting document will be printed to the console in the event of a failing response code- See Also:
setPrintContentOnFailingStatusCode(boolean)
-
setThrowExceptionOnFailingStatusCode
public void setThrowExceptionOnFailingStatusCode(boolean enabled)
Specify whether or not an exception will be thrown in the event of a failing status code. Successful status codes are in the range 200-299. The default is true.- Parameters:
enabled
-true
to enable this feature
-
isThrowExceptionOnFailingStatusCode
public boolean isThrowExceptionOnFailingStatusCode()
Returnstrue
if an exception will be thrown in the event of a failing response code.- Returns:
true
if an exception will be thrown in the event of a failing response code- See Also:
setThrowExceptionOnFailingStatusCode(boolean)
-
isThrowExceptionOnScriptError
public boolean isThrowExceptionOnScriptError()
Indicates if an exception should be thrown when a script execution fails (the default) or if it should be caught and just logged to allow page execution to continue.- Returns:
true
if an exception is thrown on script error (the default)
-
setThrowExceptionOnScriptError
public void setThrowExceptionOnScriptError(boolean enabled)
Changes the behavior of this webclient when a script error occurs.- Parameters:
enabled
- indicates if exception should be thrown or not
-
setActiveXNative
@Deprecated public void setActiveXNative(boolean allow)
Deprecated.as of version 3.4.0Sets whether to allow native ActiveX or no. Default value is false. Beware that you should never allow running native ActiveX components unless you fully trust the JavaScript code, as it is not controlled by the Java Virtual Machine.- Parameters:
allow
- whether to allow or no
-
isActiveXNative
@Deprecated public boolean isActiveXNative()
Deprecated.as of version 3.4.0Returns whether native ActiveX components are allowed or no.- Returns:
- whether native ActiveX components are allowed or no
-
getHomePage
public java.lang.String getHomePage()
Returns the client's current homepage.- Returns:
- the client's current homepage
-
setHomePage
public void setHomePage(java.lang.String homePage)
Sets the client's homepage.- Parameters:
homePage
- the new homepage URL
-
getProxyConfig
public ProxyConfig getProxyConfig()
Returns the proxy configuration for this client.- Returns:
- the proxy configuration for this client
-
setProxyConfig
public void setProxyConfig(ProxyConfig proxyConfig)
Sets the proxy configuration for this client.- Parameters:
proxyConfig
- the proxy configuration for this client
-
getTimeout
public int getTimeout()
Gets the timeout value for theWebConnection
. The default timeout is 90 seconds.- Returns:
- the timeout value in milliseconds
- See Also:
setTimeout(int)
-
setTimeout
public void setTimeout(int timeout)
Sets the timeout of the
WebConnection
. Set to zero for an infinite wait.Note: The timeout is used twice. The first is for making the socket connection, the second is for data retrieval. If the time is critical you must allow for twice the time specified here.
- Parameters:
timeout
- the value of the timeout in milliseconds
-
getConnectionTimeToLive
public long getConnectionTimeToLive()
Gets the connTimeToLive value for the HttpClient connection pool.- Returns:
- the timeout value in milliseconds
-
setConnectionTimeToLive
public void setConnectionTimeToLive(long connectionTimeToLive)
Sets the connTimeToLive of the HttpClient connection pool. Use this if you are working with web pages behind a DNS based load balancer. Set to -1 (default) for disabling this timeout.- Parameters:
connectionTimeToLive
- the value of the timeout in milliseconds
-
setSSLInsecureProtocol
public void setSSLInsecureProtocol(java.lang.String sslInsecureProtocol)
Sets the SSL protocol, used only whensetUseInsecureSSL(boolean)
is set totrue
.- Parameters:
sslInsecureProtocol
- the SSL protocol for insecure SSL connections,null
to use for default value
-
getSSLInsecureProtocol
public java.lang.String getSSLInsecureProtocol()
Gets the SSL protocol, to be used only whensetUseInsecureSSL(boolean)
is set totrue
.- Returns:
- the SSL protocol for insecure SSL connections
-
setSSLTrustStore
public void setSSLTrustStore(java.net.URL sslTrustStoreUrl, java.lang.String sslTrustStorePassword, java.lang.String sslTrustStoreType)
Sets the SSL server certificate trust store. All server certificates will be validated against this trust store.The needed parameters are used to construct a
KeyStore
.- Parameters:
sslTrustStoreUrl
- the URL which locates the trust storesslTrustStorePassword
- the trust store passwordsslTrustStoreType
- the type of trust store, usuallyjks
orpkcs12
-
setSSLTrustStore
public void setSSLTrustStore(java.security.KeyStore keyStore)
-
getSSLTrustStore
public java.security.KeyStore getSSLTrustStore()
Gets the SSL TrustStore.- Returns:
- the SSL TrustStore for insecure SSL connections
-
getMaxInMemory
public int getMaxInMemory()
Returns the maximum bytes to have in memory, after which the content is saved to a temporary file. Default is 500 * 1024.- Returns:
- the maximum bytes in memory
-
setMaxInMemory
public void setMaxInMemory(int maxInMemory)
Sets the maximum bytes to have in memory, after which the content is saved to a temporary file. Set this to zero or -1 to deactivate the saving at all.- Parameters:
maxInMemory
- maximum bytes in memory
-
getHistorySizeLimit
public int getHistorySizeLimit()
Returns the maximum number ofpages
kept inWebWindow.getHistory()
.- Returns:
- the maximum number of pages in history
-
setHistorySizeLimit
public void setHistorySizeLimit(int historySizeLimit)
Sets the History size limit. HtmlUnit uses SoftReferences<Page> for storing the pages that are part of the history. If you like to fine tune this you can usesetHistoryPageCacheLimit(int)
to limit the number of page references stored by the history.- Parameters:
historySizeLimit
- maximum number of pages in history
-
getHistoryPageCacheLimit
public int getHistoryPageCacheLimit()
Returns the maximum number ofpages
to cache in history.- Returns:
- the maximum number of pages to cache in history
-
setHistoryPageCacheLimit
public void setHistoryPageCacheLimit(int historyPageCacheLimit)
Sets the maximum number ofpages
to cache in history. If this value is smaller than the {getHistorySizeLimit()
than HtmlUnit will only use soft references for the first historyPageCacheLimit entries in the history. For older entries only the url is saved; the page will be (re)retrieved on demand.- Parameters:
historyPageCacheLimit
- maximum number of pages to cache in history default is Integer.MAX_VALUE; negative values are having the same effect as setting this to zero.
-
getLocalAddress
public java.net.InetAddress getLocalAddress()
Returns local address to be used for request execution.On machines with multiple network interfaces, this parameter can be used to select the network interface from which the connection originates.
Default:
null
- Returns:
- the local address
-
setLocalAddress
public void setLocalAddress(java.net.InetAddress localAddress)
Sets the local address to be used for request execution.On machines with multiple network interfaces, this parameter can be used to select the network interface from which the connection originates.
- Parameters:
localAddress
- the local address
-
setDownloadImages
public void setDownloadImages(boolean downloadImages)
Sets whether to automatically download images by default, or not.- Parameters:
downloadImages
- whether to automatically download images by default, or not
-
isDownloadImages
public boolean isDownloadImages()
Returns whether to automatically download images by default, or not.- Returns:
- whether to automatically download images by default, or not.
-
setScreenWidth
public void setScreenWidth(int screenWidth)
Sets the screen width.- Parameters:
screenWidth
- the screen width
-
getScreenWidth
public int getScreenWidth()
Returns the screen width.- Returns:
- the screen width
-
setScreenHeight
public void setScreenHeight(int screenHeight)
Sets the screen height.- Parameters:
screenHeight
- the screen height
-
getScreenHeight
public int getScreenHeight()
Returns the screen height.- Returns:
- the screen height
-
setWebSocketEnabled
public void setWebSocketEnabled(boolean enabled)
Enables/disables WebSocket support. By default, this property is enabled.- Parameters:
enabled
-true
to enable WebSocket support
-
isWebSocketEnabled
public boolean isWebSocketEnabled()
Returnstrue
if WebSockets are enabled.- Returns:
true
if WebSockets are enabled
-
getWebSocketMaxTextMessageSize
public int getWebSocketMaxTextMessageSize()
- Returns:
- the WebSocket maxTextMessageSize
-
setWebSocketMaxTextMessageSize
public void setWebSocketMaxTextMessageSize(int webSocketMaxTextMessageSize)
Sets the WebSocket maxTextMessageSize.- Parameters:
webSocketMaxTextMessageSize
- the new value
-
getWebSocketMaxTextMessageBufferSize
public int getWebSocketMaxTextMessageBufferSize()
- Returns:
- the WebSocket maxTextMessageBufferSize
-
setWebSocketMaxTextMessageBufferSize
public void setWebSocketMaxTextMessageBufferSize(int webSocketMaxTextMessageBufferSize)
Sets the WebSocket maxTextMessageBufferSize.- Parameters:
webSocketMaxTextMessageBufferSize
- the new value
-
getWebSocketMaxBinaryMessageSize
public int getWebSocketMaxBinaryMessageSize()
- Returns:
- the WebSocket maxTextMessageSize
-
setWebSocketMaxBinaryMessageSize
public void setWebSocketMaxBinaryMessageSize(int webSocketMaxBinaryMessageSize)
Sets the WebSocket maxBinaryMessageSize.- Parameters:
webSocketMaxBinaryMessageSize
- the new value
-
getWebSocketMaxBinaryMessageBufferSize
public int getWebSocketMaxBinaryMessageBufferSize()
- Returns:
- the WebSocket maxBinaryMessageBufferSize
-
setWebSocketMaxBinaryMessageBufferSize
public void setWebSocketMaxBinaryMessageBufferSize(int webSocketMaxBinaryMessageBufferSize)
Sets the WebSocket maxBinaryMessageBufferSize.- Parameters:
webSocketMaxBinaryMessageBufferSize
- the new value
-
setFetchPolyfillEnabled
public void setFetchPolyfillEnabled(boolean enabled)
Sets whether or not fetch polyfill should be used.- Parameters:
enabled
- true to enable fetch polyfill
-
isFetchPolyfillEnabled
public boolean isFetchPolyfillEnabled()
- Returns:
- true if the fetch api polyfill is enabled
-
-