Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: WebEngine

[10:7] extends: FxObj

Wraps JavaFX WebEngine, the non-visual web page loader and DOM manager embedded inside a WebView. Use it to load URLs, inject HTML content, run JavaScript, and query the current page location. Obtain an instance via WebView.getEngine().

Methods

  • load (string Url)

    Loads the web page at the given URL into the engine.

    • @p Url is a string with the URL to load (e.g., "https://example.com").
    • @r this object
  • loadContent (string HtmlContent)

    Loads the given HTML string directly into the engine as a new page.

    • @p HtmlContent is a string containing the HTML markup to render.
    • @r this object
  • getLocation ()

    Returns the URL of the currently loaded page.

    • @r A string with the current page URL, or an empty string if no page is loaded.
  • getTitle ()

    Returns the title of the currently loaded page.

    • @r A string with the page title, or null if no title is set.
  • executeScript (string Script)

    Executes a JavaScript expression in the context of the currently loaded page.

    • @p Script is a string containing the JavaScript expression to evaluate.
    • @r The result of the JavaScript expression, or null for void results.
  • reload ()

    Reloads the currently loaded page.

    • @r this object