tr1ckydev / webview-bun

Bun bindings for webview, a tiny library for creating web-based desktop GUIs.
https://www.npmjs.com/package/webview-bun
MIT License
239 stars 10 forks source link

add onClose event #8

Closed ShadyShenAli closed 4 months ago

ShadyShenAli commented 5 months ago

Is it possible to also add onClose event so that additional clean-up can be triggered if user close the webview.

tr1ckydev commented 4 months ago

Any code written after webview.run() will be executed as soon as the window is closed as run() blocks the current thread until the windows closes.

webview.run();
console.log("closed");