classafReflux::Browser

sys::Obj
  fwt::Widget
    fwt::Pane
      afReflux::Browser

(Widget) - A HTML and web browser widget. Browser is a drop in replacement for the standard FWT WebBrowser with the following enhancements:

  • Javascript support
  • Title and status text support
  • WebBrowser bug fixes - see Topic #2069

Use the html and url fields to load content into the browser:

browser.html = "<html><body>Fantom-Factory<body></html>"

browser.url = `http://www.fantomfactory.org/`

See SWT Browser

back

Source

This back()

Navigate to the previous session history.

evaluate

Source

Obj? evaluate(Str script)

Returns the result, if any, of executing the specified script.

The the last Javascript statement should be a return statement:

browser.evaluate("alert('Hello Mum!'); return document.title;")
execute

Source

Void execute(Str script)

Executes the specified script. If document-defined functions or properties are accessed by the script then this method should not be invoked until the document has finished loading.

browser.execute("alert('Hello Mum!');")

Throws Err if the script did not complete successfully.

forward

Source

This forward()

Navigate to the next session history.

html

Source

Str? html

Gets / sets the HTML in the current page.

browser.html = "<html><body>Fantom-Factory<body></html>"
javascriptEnabled

Source

Bool javascriptEnabled

Whether javascript is enabled in the browser. Note this only affects pages loaded after the value is set.

Source

EventListeners onHyperlink()

Callback when the user clicks a hyperlink. The callback is invoked before the actual hyperlink. The event handler can modify the data field with a new URI or set to null to cancel the hyperlink.

Event id fired:

  • EventId.hyperlink

Event fields:

  • Event.data: the sys::Uri of the new page.
onLoad

Source

EventListeners onLoad()

Callback when the page loading is complete. DOM elements should be available for Javascript interaction at this time.

Event id fired:

  • EventId.unknown
onStatusText

Source

EventListeners onStatusText()

Callback when the status bar text changes.

Event id fired:

  • EventId.unknown

Event fields:

  • Event.data: the status bar text.
onTitleText

Source

EventListeners onTitleText()

Callback when the title text is available or is modified.

Event id fired:

  • EventId.unknown

Event fields:

  • Event.data: the title text.
refresh

Source

This refresh()

Refresh the current page.

stop

Source

This stop()

Stop any load activity.

url

Source

Uri? url

Gets / sets the URL loaded in the browser.

browser.url = `http://www.fantomfactory.org/`