Package velox.gui.browser
Class BrowserSettings
java.lang.Object
velox.gui.browser.BrowserSettings
Optional settings for browsers created through
BrowserFactory.
Api domains. A page loaded from a non-whitelisted domain is not allowed to send messages to
BrowserListener.onMessage, and thus cannot access any API exposed through the listener.
This protects the API when a well-intended page navigates to a malicious 3rd party page.
Domain "bookmap.com" is always whitelisted, and subdomains of whitelisted domains are
allowed too. Pages opened directly from html rather than URL are not subject to this restriction.
The debug key browser_api_domains_all disables the check.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddApiDomain(String domain) Adds a domain allowed to send messages to the browser, in addition to "bookmap.com".setListener(BrowserListener listener) Sets the listener receiving page events and messages, seeBrowserListener.
-
Field Details
-
DEFAULT_API_DOMAIN
- See Also:
-
-
Constructor Details
-
BrowserSettings
public BrowserSettings()
-
-
Method Details
-
setListener
Sets the listener receiving page events and messages, seeBrowserListener.- Returns:
- this.
-
getListener
-
addApiDomain
Adds a domain allowed to send messages to the browser, in addition to "bookmap.com". Plain host name like"example.com", no scheme.Pages loaded from HTML are not subject to this restriction, but only for page loads initiated through Browser API.
- Returns:
- this.
-
getApiDomains
-