mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-20 17:22:08 +03:00
24 lines
566 B
HTML
24 lines
566 B
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<body>
|
||
|
<script>
|
||
|
function notify(route, args) {
|
||
|
var xhr = new XMLHttpRequest()
|
||
|
xhr.open('POST', 'http://localhost:7000/' + route)
|
||
|
xhr.setRequestHeader('Content-type', 'application/json')
|
||
|
xhr.send(JSON.stringify(args))
|
||
|
}
|
||
|
|
||
|
window.onTauriInit = function () {
|
||
|
window.tauri.listen('reply', function (res) {
|
||
|
notify('reply', res.payload)
|
||
|
})
|
||
|
window.tauri.emit('hello')
|
||
|
}
|
||
|
setTimeout(function () {
|
||
|
window.tauri.invoke({ cmd: 'exit' })
|
||
|
}, 1000)
|
||
|
</script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|