Class BrowserSettings

java.lang.Object
velox.gui.browser.BrowserSettings

public class BrowserSettings extends Object
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 Details

  • Constructor Details

    • BrowserSettings

      public BrowserSettings()
  • Method Details

    • setListener

      public BrowserSettings setListener(@Nullable BrowserListener listener)
      Sets the listener receiving page events and messages, see BrowserListener.
      Returns:
      this.
    • getListener

      @Nullable public BrowserListener getListener()
    • addApiDomain

      public BrowserSettings addApiDomain(String domain)
      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

      public List<String> getApiDomains()