DEV Community

loading...

Performant WebView alternatives to Electron

patarapolw profile image Pacharapol Withayasakpunt ・1 min read

Have you found anything better than Electron for WebView?

Non-performant solutions

  • QtWebEngine
  • JavaFx WebView

Similar-in-heaviness solutions

  • NW.js

Lightweight, but less choice solutions

I find that SWT might be a solution for me, when I don't want to write backend in JavaScript/TypeScript...

But, do we really need to put web browser in the desktop application in the first place? Why not just web server on localhost?

Discussion (5)

pic
Editor guide
Collapse
stevepryde profile image
Steve Pryde

The one thing I like about putting a web browser in a desktop application is that HTML5/CSS is a very powerful language combo for designing layout and appearance. It is much more powerful and flexible than any GUI library I'm aware of (I've used Win32, Gtk, Qt, and Wx), and allows UI/UX designers so much more freedom and control over the entire application's look and feel.

Once upon a time the conventional wisdom was that users want all of their applications to look the same, and that in order to achieve consistency and make applications "user-friendly" they had to follow a rigid set of UI guidelines set forth by the OS and its one-and-only GUI toolkit. I think as the world moves increasingly towards the web this paradigm is slowly being left behind. There are some trends in web design that allow for some consistency in expected website behaviours while also allowing greater design flexibility as well. We expect navbars, menus, tables, dropdowns, settings pages, etc to all work in a certain way, and for the most part the average web user can find their way around pretty well.

I think putting a browser layout/rendering engine in a desktop app is actually a fairly natural bridge between the two worlds, at least until PWA's become fully supported at the OS level. I think the future will be full of thin web apps that behave like traditional desktop apps but use web technologies rather than the heavy GUI toolkits from yesterday. There is work to do in reducing the overhead. I think we'll see the actual browser engine abstracted into shared libraries or similar - we don't need a separate copy of chromium for every desktop app.

Collapse
stevepryde profile image
Steve Pryde

I should mention that I have used Electron and found it visually great but otherwise bulky and slow. There is plenty of room to improve in this space.

I'm optimistic we'll see WebRender (Firefox's new rendering engine written in Rust) baked into a WASM-capable desktop app framework in the near future. One such project is Azul, which I'm not involved in but am watching with interest. Hopefully we'll see others as well.

Collapse
negue profile image
negue

This is pretty new, I don't know if it's better but the executable size is way smaller than electron.

blog.stevensanderson.com/2019/11/1...

I haven't tried it out yet, but looks promising :)

Collapse
patarapolw profile image
Pacharapol Withayasakpunt Author

But I am not sure how to work it out on MacOS...

Collapse
shvahabi profile image
شاهد

Why not just web server on localhost? Consider this scenario: user has installed some add-ons on his default browser which restricts some functionality. Or some security settings such as CORS may also interfere.