3 ms·
Webviews don't work because they solve very different problems. System webviews will always have different features, break things, and are entirely uncontrolla
by devwastaken 6y ago
Webviews don't work because they solve very different problems.
System webviews will always have different features, break things, and are entirely uncontrollable by the software distributor. This means your software will not be resilient to the future.
You cannot access the JS engine the same as you can V8 in most webviews. This means you can't interop with C libraries without some performance destroying hack like copying everything into the JS space through sockets.
This also means something as simple as reading a file has to, again, cross the sandbox in an inefficient way. You'd have the browser, it's javascript engine, and your own runtime in node or python or however too.
Electron develops patches that make chromium more performant and feature ready for desktop.
Electron conjoins the chromium and node v8 event loop to take advantage of libuv - again a performance improvement.
The decision of webviews and electron is based on what you're trying to do. If it's simple html/JS that's pretty much self contained then sure.
- andrew_ 6y agoIt's been a minute since I attempted it on Windows, but transparency of borders and borderless windows with the webview on Windows was next to impossible. It's one of the reasons we used Electron. I'm curious to know if they've solved that, but can't find my mention of it.
- saagarjha 6y agoIf you cared about performance, would you really be using Electron?
- innocenat 6y agoYes. Why not? HTML/CSS great (from the development POV) for UI, and I can always write the performance critical code in C and linked them to the electron HTML/CSS frontend.
- saagarjha 6y agoPresumably, if copying some data between JavaScript and native code in a slightly roundabout way was an issue, you wouldn't run things through web technology in the first place…
- innocenat 6y agoIf you pass data with ArrayBuffer it's non-copying, so even large data is fine.
- deleted 6y ago[deleted]