(system webview)

Webview Bindings

(import (system webview))

Bindings to a modified version of the webview library.

Main Interface

procedure: (webview title url on-external-invoke option ...)

Launch a webview with the given title, URL, external invocation callback and possibly additional configuration options.

The external invocation callback receives two arguments: The webview and a string. The string argument is provided by JavaScript on the page using a call to window.external.invoke.

Both the URL and callback procedure may be #f. If no URL is passed, an empty default page is used that calls window.external.invoke("load") once when loaded. If no callback procedure is passed, window.external.invoke is available but does nothing.

The list of additional configuration options may contain the following keys:

procedure: (webview-terminate! webview)

Ask the given webview to quit.

procedure: (webview-title-set! webview title)

Change the title of the given webview.

procedure: (webview-fullscreen-set! webview fullscreen?)

Change the fullscreen state of the given webview.

procedure: (webview-color-set! webview red green blue alpha)

Change the background color of the given webview.

procedure: (webview-eval webview code)

Evaluate JavaScript code in the given webview.

Dialog Interface

syntax: (dialog-type-flag symbol)

syntax: (dialog-type symbol ...)

The dialog flags enumeration is used to indicate the type of dialog presented by webview-dialog:

procedure: (webview-dialog webview type title value)

procedure: (webview-dialog webview type title)

Present a dialog as a modal child of the given webview. Returns the data selected in the dialog or #f.


procedure: (logf fmt arg ...)

Log a formatted message to some system-specific channel.