mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-23 02:32:28 +03:00
19 lines
564 B
JavaScript
19 lines
564 B
JavaScript
const WebviewWindow = window.__TAURI__.window.WebviewWindow
|
|
|
|
const routeSelect = document.querySelector('#route')
|
|
const link = document.querySelector('#link')
|
|
|
|
routeSelect.addEventListener('change', (event) => {
|
|
link.href = event.target.value
|
|
})
|
|
|
|
document.querySelector('#go').addEventListener('click', () => {
|
|
window.location.href = window.location.origin + '/' + routeSelect.value
|
|
})
|
|
|
|
document.querySelector('#open-window').addEventListener('click', () => {
|
|
new WebviewWindow(Math.random().toString().replace('.', ''), {
|
|
url: routeSelect.value
|
|
})
|
|
})
|