Document

Represents the in-browser Document Object Model, corresponding to the JavaScript document object.

Passed in as doc to the buildPage lambda of the Kweb constructor.

Constructors

Link copied to clipboard
constructor(receiver: WebBrowser)

Properties

Link copied to clipboard
Link copied to clipboard
open override val browser: WebBrowser
Link copied to clipboard

Returns a CookieReceiver which can be used to read and write cookies, note that localStorage is a more modern alternative to this mechanism.

Link copied to clipboard
Link copied to clipboard

Allows data to be stored in and retrieved from the browser's local storage.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Allows data to be stored in and retrieved from the browser's session storage.

Functions

Link copied to clipboard
open override fun addEventListener(eventName: String, returnEventFields: Set<String>, retrieveJs: String?, preventDefault: Boolean, callback: (JsonElement) -> Unit): Document
Link copied to clipboard
open override fun addImmediateEventCode(eventName: String, jsCode: String)
Link copied to clipboard
Link copied to clipboard
fun execCommand(command: String)
Link copied to clipboard
Link copied to clipboard
suspend fun getOrigin(): Any
Link copied to clipboard
Link copied to clipboard
fun on(retrieveJs: String? = null, preventDefault: Boolean = false): OnReceiver<Document>

You can supply a javascript expression retrieveJs which will be available via Event.retrieveJs