on

fun on(retrieveJs: String? = null, preventDefault: Boolean = false): OnReceiver<Window>(source)

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


See here.