public class XWalkSettings
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XWalkSettings.LayoutAlgorithm
This enum corresponds to WebSettings.LayoutAlgorithm.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
LOAD_CACHE_ELSE_NETWORK
Use cached resources when they are available, even if they have expired.
|
static int |
LOAD_CACHE_ONLY
Don't use the network, load from the cache.
|
static int |
LOAD_DEFAULT
Default cache usage mode.
|
static int |
LOAD_NO_CACHE
Don't use the cache, load from the network.
|
| Constructor and Description |
|---|
XWalkSettings(java.lang.Object bridge) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAcceptLanguages()
Get the accept languages of XWalkView.
|
boolean |
getAllowContentAccess()
Gets whether this XWalkView supports content URL access.
|
boolean |
getAllowFileAccess()
Gets whether this XWalkView supports file access.
|
boolean |
getAllowFileAccessFromFileURLs()
Gets whether JavaScript running in the context of a file scheme URL can
access content from other file scheme URLs.
|
boolean |
getAllowUniversalAccessFromFileURLs()
Gets whether JavaScript running in the context of a file scheme URL can
access content from any origin.
|
boolean |
getBlockNetworkImage()
Gets whether the XWalkView does not load image resources from the network.
|
boolean |
getBlockNetworkLoads()
Gets whether the XWalkView does not load any resources from the network.
|
protected java.lang.Object |
getBridge() |
boolean |
getBuiltInZoomControls()
Gets whether the zoom mechanisms built into XWalkView are being used.
|
int |
getCacheMode()
Gets the current setting for overriding the cache mode.
|
boolean |
getDatabaseEnabled()
Gets whether the database storage API is enabled.
|
int |
getDefaultFixedFontSize()
Gets the default fixed font size.
|
int |
getDefaultFontSize()
Gets the default font size.
|
boolean |
getDomStorageEnabled()
Gets whether the DOM Storage APIs are enabled.
|
boolean |
getJavaScriptCanOpenWindowsAutomatically()
Gets whether JavaScript can open windows automatically.
|
boolean |
getJavaScriptEnabled()
Gets whether JavaScript is enabled.
|
XWalkSettings.LayoutAlgorithm |
getLayoutAlgorithm()
Gets the current layout algorithm.
|
boolean |
getLoadsImagesAutomatically()
Gets whether the XWalkView loads image resources.
|
boolean |
getLoadWithOverviewMode()
Gets whether this XWalkView loads pages in overview mode.
|
boolean |
getMediaPlaybackRequiresUserGesture()
Gets whether the XWalkView requires a user gesture to play media.
|
boolean |
getSaveFormData()
Gets whether the XWalkView saves form data.
|
boolean |
getSupportQuirksMode()
Gets whether the XWalkView should support the quirks mode.
|
boolean |
getSupportSpatialNavigation()
Gets whether the XWalkView should support the spatial navigation.
|
int |
getTextZoom()
Gets the text zoom of the page in percent.
|
java.lang.String |
getUserAgentString()
Get the user agent of web page/app.
|
boolean |
getUseWideViewPort()
Gets whether the XWalkView supports the "viewport" HTML meta tag or will
use a wide viewport.
|
void |
setAcceptLanguages(java.lang.String acceptLanguages)
Set the accept languages of XWalkView.
|
void |
setAllowContentAccess(boolean allow)
Enables or disables content URL access within XWalkView.
|
void |
setAllowFileAccess(boolean allow)
Enables or disables file access within XWalkView.
|
void |
setAllowFileAccessFromFileURLs(boolean flag)
Sets whether JavaScript running in the context of a file scheme URL
should be allowed to access content from other file scheme URLs.
|
void |
setAllowUniversalAccessFromFileURLs(boolean flag)
Sets whether JavaScript running in the context of a file scheme URL
should be allowed to access content from any origin.
|
void |
setBlockNetworkImage(boolean flag)
Sets whether the XWalkView should not load image resources from the
network (resources accessed via http and https URI schemes).
|
void |
setBlockNetworkLoads(boolean flag)
Sets whether the XWalkView should not load resources from the network.
|
void |
setBuiltInZoomControls(boolean enabled)
Sets whether the XWalkView should use its built-in zoom mechanisms.
|
void |
setCacheMode(int mode)
Overrides the way the cache is used.
|
void |
setDatabaseEnabled(boolean flag)
Sets whether the database storage API is enabled.
|
void |
setDefaultFixedFontSize(int size)
Sets the default fixed font size.
|
void |
setDefaultFontSize(int size)
Sets the default font size.
|
void |
setDomStorageEnabled(boolean flag)
Sets whether the DOM storage API is enabled.
|
void |
setInitialPageScale(float scaleInPercent)
Sets the initial scale for this XWalkView.
|
void |
setJavaScriptCanOpenWindowsAutomatically(boolean flag)
Tells JavaScript to open windows automatically.
|
void |
setJavaScriptEnabled(boolean flag)
Tells the XWalkView to enable JavaScript execution.
|
void |
setLayoutAlgorithm(XWalkSettings.LayoutAlgorithm la)
Sets the underlying layout algorithm.
|
void |
setLoadsImagesAutomatically(boolean flag)
Sets whether the XWalkView should load image resources.
|
void |
setLoadWithOverviewMode(boolean overview)
Sets whether the XWalkView loads pages in overview mode, that is, zooms out
the content to fit on screen by width.
|
void |
setMediaPlaybackRequiresUserGesture(boolean require)
Sets whether the XWalkView requires a user gesture to play media.
|
void |
setSaveFormData(boolean enable)
Sets whether the XWalkView should save form data.
|
void |
setSupportMultipleWindows(boolean support)
Sets whether the XWalkView supports multiple windows.
|
void |
setSupportQuirksMode(boolean enable)
Sets whether the XWalkView should support the quirks mode.
|
void |
setSupportSpatialNavigation(boolean enable)
Sets whether the XWalkView should support the spatial navigation,
like a TV remote control.
|
void |
setSupportZoom(boolean support)
Sets whether the XWalkView should support zooming using its on-screen zoom controls
and gestures.
|
void |
setTextZoom(int textZoom)
Sets the text zoom of the page in percent.
|
void |
setUserAgentString(java.lang.String userAgent)
Set the user agent of web page/app.
|
void |
setUseWideViewPort(boolean use)
Sets whether the XWalkView should enable support for the "viewport" HTML
meta tag or should use a wide viewport.
|
boolean |
supportMultipleWindows()
Gets whether the XWalkView supports multiple windows.
|
boolean |
supportsMultiTouchZoomForTest()
Note: Just for test case.
|
boolean |
supportZoom()
Gets whether the XWalkView supports zoom.
|
public static final int LOAD_DEFAULT
setCacheMode(int).public static final int LOAD_CACHE_ELSE_NETWORK
setCacheMode(int).public static final int LOAD_NO_CACHE
setCacheMode(int).public static final int LOAD_CACHE_ONLY
setCacheMode(int).protected java.lang.Object getBridge()
public void setCacheMode(int mode)
LOAD_DEFAULT,
LOAD_CACHE_ELSE_NETWORK, LOAD_NO_CACHE or
LOAD_CACHE_ONLY. The default value is LOAD_DEFAULT.mode - the mode to usepublic int getCacheMode()
setCacheMode(int)public void setBlockNetworkLoads(boolean flag)
setBlockNetworkImage(boolean) to only avoid loading
image resources. Note that if the value of this setting is
changed from true to false, network resources referenced by content
currently displayed by the XWalkView are not fetched until
XWalkView.reload(int) is called.
If the application does not have the
Manifest.permission.INTERNET permission, attempts to set
a value of false will cause a SecurityException
to be thrown. The default value is false if the application has the
Manifest.permission.INTERNET permission, otherwise it is
true.flag - whether the XWalkView should not load any resources from the
networkXWalkView.reload(int)public boolean getBlockNetworkLoads()
setBlockNetworkLoads(boolean)public void setAllowFileAccess(boolean allow)
public boolean getAllowFileAccess()
setAllowFileAccess(boolean)public void setAllowContentAccess(boolean allow)
public boolean getAllowContentAccess()
setAllowContentAccess(boolean)public void setJavaScriptEnabled(boolean flag)
flag - true if the XWalkView should execute JavaScriptpublic void setAllowUniversalAccessFromFileURLs(boolean flag)
setAllowFileAccessFromFileURLs(boolean). To enable the most restrictive,
and therefore secure policy, this setting should be disabled.
Note that this setting affects only JavaScript access to file scheme
resources. Other access to such resources, for example, from image HTML
elements, is unaffected. The default value is false.flag - whether JavaScript running in the context of a file scheme
URL should be allowed to access content from any originpublic void setAllowFileAccessFromFileURLs(boolean flag)
getAllowUniversalAccessFromFileURLs() is true.
Note too, that this setting affects only JavaScript access to file scheme
resources. Other access to such resources, for example, from image HTML
elements, is unaffected. The default value is false.flag - whether JavaScript running in the context of a file scheme
URL should be allowed to access content from other file
scheme URLspublic void setLoadsImagesAutomatically(boolean flag)
setBlockNetworkImage(boolean) to control loading only
of images specified using network URI schemes. Note that if the value of this
setting is changed from false to true, all images resources referenced
by content currently displayed by the XWalkView are loaded automatically.
The default is true.flag - whether the XWalkView should load image resourcespublic boolean getLoadsImagesAutomatically()
setLoadsImagesAutomatically(boolean)public void setBlockNetworkImage(boolean flag)
getLoadsImagesAutomatically() returns true. Also note that
disabling all network loads using setBlockNetworkLoads(boolean)
will also prevent network images from loading, even if this flag is set
to false. When the value of this setting is changed from true to false,
network images resources referenced by content currently displayed by
the XWalkView are fetched automatically. The default is false.flag - whether the XWalkView should not load image resources from the
networksetBlockNetworkLoads(boolean)public boolean getBlockNetworkImage()
setBlockNetworkImage(boolean)public boolean getJavaScriptEnabled()
setJavaScriptEnabled(boolean)public boolean getAllowUniversalAccessFromFileURLs()
setAllowUniversalAccessFromFileURLs(boolean)public boolean getAllowFileAccessFromFileURLs()
setAllowFileAccessFromFileURLs(boolean)public void setJavaScriptCanOpenWindowsAutomatically(boolean flag)
flag - true if JavaScript can open windows automaticallypublic boolean getJavaScriptCanOpenWindowsAutomatically()
setJavaScriptCanOpenWindowsAutomatically(boolean)public void setSupportMultipleWindows(boolean support)
XWalkUIClient.onCreateWindowRequested(org.xwalk.core.XWalkView, org.xwalk.core.XWalkUIClient.InitiateBy, android.webkit.ValueCallback<org.xwalk.core.XWalkView>) must be implemented
by the host application. The default is false.support - whether to suport multiple windowspublic boolean supportMultipleWindows()
setSupportMultipleWindows(boolean)public void setUseWideViewPort(boolean use)
use - whether to enable support for the viewport meta tag.public boolean getUseWideViewPort()
public void setDomStorageEnabled(boolean flag)
flag - true if the XWalkView should use the DOM storage APIpublic boolean getDomStorageEnabled()
setDomStorageEnabled(boolean)public void setDatabaseEnabled(boolean flag)
flag - true if the XWalkView should use the database storage APIpublic boolean getDatabaseEnabled()
public void setMediaPlaybackRequiresUserGesture(boolean require)
require - whether the XWalkView requires a user gesture to play mediapublic boolean getMediaPlaybackRequiresUserGesture()
setMediaPlaybackRequiresUserGesture(boolean)public void setUserAgentString(java.lang.String userAgent)
userAgent - the user agent string passed from client.public java.lang.String getUserAgentString()
public void setAcceptLanguages(java.lang.String acceptLanguages)
acceptLanguages - the accept languages string passed from client.public java.lang.String getAcceptLanguages()
public void setSaveFormData(boolean enable)
public boolean getSaveFormData()
setSaveFormData(boolean)public void setInitialPageScale(float scaleInPercent)
scaleInPercent - the initial scale in percent.public void setTextZoom(int textZoom)
textZoom - the text zoom in percent.public int getTextZoom()
public void setDefaultFontSize(int size)
size - non-negative integer between 1 and 72.
Any number outside the specified range will be pinned.public int getDefaultFontSize()
public void setDefaultFixedFontSize(int size)
size - a non-negative integer between 1 and 72.
Any number outside the specified range will be pinned.public int getDefaultFixedFontSize()
public void setSupportZoom(boolean support)
support - whether the XWalkView should support zoom.public boolean supportZoom()
public void setBuiltInZoomControls(boolean enabled)
enabled - whether the XWalkView should use its built-in zoom mechanisms.public boolean getBuiltInZoomControls()
public boolean supportsMultiTouchZoomForTest()
public void setSupportSpatialNavigation(boolean enable)
enable - whether the XWalkView should support the spatial navigation.public boolean getSupportSpatialNavigation()
public void setSupportQuirksMode(boolean enable)
enable - whether the XWalkView should support the quirks mode.public boolean getSupportQuirksMode()
public void setLayoutAlgorithm(XWalkSettings.LayoutAlgorithm la)
la - the layout algorithm to use.public XWalkSettings.LayoutAlgorithm getLayoutAlgorithm()
public void setLoadWithOverviewMode(boolean overview)
overview - whether this XWalkView loads pages in overview mode.public boolean getLoadWithOverviewMode()