Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Electron vs. Offline HTML5 for an offline application

Tags:

html

electron

When looking up Electron and Offline HTML5, I have found it difficult to make a decision between which one to use for a project.

Assuming that a user will have to go to a certain website to download the Electron application, and would have to go to the same website to get the Offline HTML5 loaded, what are the pros and cons between using one over the other?

Some that I could think of:

  • Offline HTML5 can be updated without the user consciously updating their application by just making the user go to the online page again.
  • Electron would eliminate the need to code around multiple browser/browser version dependencies and quirks
like image 782
user24984 Avatar asked Aug 19 '15 13:08

user24984


People also ask

Can Electron apps work offline?

Completely offline won't work, AFAIK, because the NPM module electron does not provide the correct version of the required executable files.

Is Electron the best for desktop apps?

If you prefer working with projects that have a larger community, Electron is a great choice. If you use Rust and want fast desktop web apps, Tauri works well. Finally, if you want to get to market quickly, mobile support, and don't want to maintain two versions of your app, PWAs might work well.

Can you make Web apps with Electron?

It's easier than you thinkElectron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.

Why is Electron app slow?

It is slow It is just the renderer, and just like a web app in a regular browser, it uses HTML, CSS and JavaScript to build an interface and provide functionality. Those are a lot of extra layers. And because of this additional abstraction, it can be slower than a finely tuned native app.


1 Answers

It really depends on your exact requirements. The following is a list of everything that I came up with:

  • electron supports module system (i.e. require) both in main and renderer processes.
  • electron provides you access to OS APIs (e.g. fs). Without such many node modules will not work in the JS runtime of the browser (e.g. ip).
  • updating your app with electron is as easy as sending an http request. (or even better as described here)
  • an HTML 5 offline app requires a browser and the user might just give it IE6.
  • electron integrates with native desktop environment (see dialog, power-save-blocker, shell or even app for some examples)
  • electron enhances some of HTML5 APIs such as file API
  • electron lets you modify the default behavior of underlying chromium. For example you could intercept all URLs with file scheme and modify them on the fly*.

In short if you want your app to have a good native integration and act deterministic (i.e. no browser quirks) I suggest choosing electron.


*electron-jade for example takes use of protocol API to compile all files ending with .jade on the fly without the need to prior compilation.

DISCLAIMER: I am the developer of electron-jade.

like image 66
Yan Foto Avatar answered Sep 19 '22 13:09

Yan Foto