tauri/cli/tauri.js/test/jest/fixtures/app/dist/index.html

24 lines
566 B
HTML
Raw Normal View History

2020-03-07 19:40:24 +03:00
<!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>