Interface IWebSettings
interface IWebSettings
Extends com.amazon.apmf.IStandard
HeadlessWebRuntime settings data object using which apps can control
the HeadlessWebRuntime behavior
Methods
enableJavaScript()
Enables JavaScript.voidenableJavaScript(boolenable)
Parameters
enable
bool — Required
isJavaScriptEnabled()
bool isJavaScriptEnabled()
Returns whether JavaScript is enabled or not.
Returns
bool
true if JavaScript is enabled, false otherwise.
enableFileAccess()
Enables local file access to HeadlessWebRuntime. This is useful when apps want to access locally stored html/js/css files. Default setting is “false”. Local file path URL will look like “file:///pkg/myfolder/myfile.html” Note that to access files stored under application package’svoidenableFileAccess(boolenable)
assets folder, do not need to enable this settings.
Parameters
enable
bool — Required
isFileAccessEnabled()
bool isFileAccessEnabled()
Returns whether file access is enabled or not.
Returns
bool
true if file access is enabled, false otherwise.
setUserAgent()
Sets the user agent.voidsetUserAgent(stringuserAgent)
Parameters
userAgent
string — Required
getUserAgent()
string getUserAgent()
Returns the current UserAgent. Default userAagent contains, OS, Device, Web engine
name and version strings. This information is subject to change, hence do not rely on
specific values of userAgent string.
Returns
string
The UserAgent string.

