 WebviewWindow(newLabelEl.value, {
          title: newTitleEl.value
        })
      })

      const currentWindow = getCurrentWebviewWindow()
      const messagesView = document.querySelector('#messages-view')
      window.addEventListener('DOMContentLoaded', () => {
        currentWindow.listen('message', (event) => {
          const time = new Date().toLocaleTimeString()
          messagesView.textContent = `${messagesView.textContent}\n[${time}] ${event.payload}`
        })
      })
    </script>
  </b