added the start of an experimental browser API so we can access the browser environment from a typesafe kotlin API which can be implemented on a JVM (e.g. with JavaFX) or compiled natively to JS to reuse the browser global variables
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package kotlin.browser
|
||||
|
||||
import org.w3c.dom.Document
|
||||
|
||||
private var _document: Document? = null
|
||||
|
||||
/**
|
||||
* Provides access to the current active browsers DOM for the currently visible page.
|
||||
*/
|
||||
var document: Document
|
||||
get() = _document!!
|
||||
set(value) {
|
||||
_document = value
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
## Browser API
|
||||
|
||||
Provides a simple typesafe API for accessing the browser context which can be used when Kotlin is compiled into JavaScript or when Kotlin is used on a JVM for example using [JavaFX](https://github.com/koolapp/koolapp/tree/master/koolapp-javafx), custom browser widgets such as in SWT or Qt, with remote control browser APIs like GWT or Selenium.
|
||||
Reference in New Issue
Block a user