Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IWebSettings

interface IWebSettings
Extends com.amazon.apmf.IStandard HeadlessWebRuntime settings data object using which apps can control the HeadlessWebRuntime behavior

Methods

enableJavaScript()

void enableJavaScript(bool enable)
Enables JavaScript.

Parameters

enable
bool — Required

isJavaScriptEnabled()

bool isJavaScriptEnabled()
Returns whether JavaScript is enabled or not.

Returns

bool true if JavaScript is enabled, false otherwise.

enableFileAccess()

void enableFileAccess(bool enable)
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’s 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()

void setUserAgent(string userAgent)
Sets the user agent.

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.
Last modified on October 29, 2026