[ANN] Webviews.jl - a tiny library for creating web-based desktop GUIs

Thanks so much for your interest!

  • The current APIs of Webviews.jl are designed as closely as what the original webview library does, but I’m considering changing some of it. Right now, a webview is not exactly a window, because you can initialize the webview to be embedded into a previously-created parent window by passing unsafe_window_handle in the constructor.
    So the original library doesn’t have close, and its terminate function means to end the webview instance instead of closing the window or ending the whole program. But actually, the original library also has many problems (e.g. terminate doesn’t work on macOS), that are resolved in our implementation.
    I think extending Base.close does make sense right now since the webview and window are closely related to each other. I’ll add it in a future version. Distinguishing closing a window and closing a webview might make sense if I decide to realize the idea in the PS above, though.

  • run(w) will automatically call destroy once the webview is terminated. So you cannot rerun a Webview instance. In fact, it is also recommended in the main context (instead of @async). I may also change the API in the future to make it more flexible to integrate with Julia’s event loop. One idea I have right now is to export something like run_one_iteration, but it’s also like reinventing tao/winit that handles event loops and window management.

  • For widgets like navigation arrows, since they should be part of the window instead of the webview, they won’t be included in this package, but maybe some extension package can be implemented in the future (still, like what I mentioned above, something similar to tauri). By the way, in this specific case, you can right-click the empty area in the website to go back/forward/reload/stop.

2 Likes