What are the pros and cons of Chrome Apps compared to Electron?

12,384

Solution 1

You can totally compare electron and chrome packaged Apps. They are very similar. For both of them you get:

  • Develop your Desktop App using Web Technologies
  • App runs on top of Chrome
  • Automatic updates. Though in Chrome you get it for free, for Electron you need to do some work.
  • OS Integration - Both have better integrations with the OS than a normal website, but Electron supports a wider range of OS integration.
  • Work offline or online.
  • Both work on Linux, OSX and Windows. Chrome Web Apps also work on Chromebooks.

Here are the differences:

  • Electron uses node.js. So you can import many modules not easily available in Chrome Apps.
  • Distribution, with electron you package and distribute the app yourself. With Chrome Apps you distribute them through Chrome Webstore.
  • Environment. An Electron App is packaged with its full environment. Chrome Apps just use Chrome environment so they are lighter, but may behave differently for different users depending on the Chrome version they use.
  • Chrome Apps require the user to have Chrome installed, Electron doesn't.
  • Electron has better developer tools for testing and debugging.
  • Electron is an open source platform. Chrome Apps is also built on top of multiple open technologies but specially distribution is controlled by Google.
  • Electron documentation is much better even though it's a much younger platform.
  • Adoption: There are quite a lot of big and successful apps built on top of Electron such as Visual Studio Code, GitHub client, Slack. Chrome Apps just never picked up as much momentum.
  • Chrome Apps can be tightly integrated into Google Drive

UPDATE 2016-08-19:

It seems Google recently deprecated Chrome Apps on any platform other than ChromeOS. So I'd say it's no longer a valid option.

http://blog.chromium.org/2016/08/from-chrome-apps-to-web.html

Solution 2

I think it is not really possible to compare electron and chrome-apps. It depends on, what your program should do.

So, when should I use electron?

On the first look electron looks like chrome, because the views of electron is based on the chrome browser. But electron is a full node.js environment with a chrome view on top. So the powerful features are not just insight the chrome part.

Like you mentioned there are a lot of node modules (over 1.700.000), which you can very easy install or update. You should also take a look at the node.js api (https://nodejs.org/api/). All that allows you to write complex apps, which are fully integrated on your desktop. For nearly all problems are some modules available.

With node you can first make your program with a command line interface and after that you can use electron to make a gui.

So, when you already have a online app which is written in JS, maybe a chrome-app is better. Chrome-apps are great for a google drive use. Or if you want to have a full integration in chrome-os.

So my pros for electron:

  • more than 1.700.000 modules over npm available
    • very easy integration of jQuery, Angular, React, ...
  • first make a program with a CLI and then make a gui
  • works perfect with github
  • very good desktop integration
  • provide windows installers

Solution 3

I would like to chime in on Electron vs nw.js.

I have a very popular Chrome App which cannot be converted to neither a web app nor an extension because it uses several unsupported APIs, most notably the chrome.fileSystem API.

The app is still only accessible on Chrome's webstore since app support will be abandoned not before early 2018. Nevertheless, I have already spent lots of thoughts and time on deciding what to do about Google's move.

Until now I have been mainly aiming at Electron since that seems to get most attention, but I have just recently found that nw.js can actually run Chrome apps out of the box because it implements all Chrome's APIs whereas Electron only implements a subset of them.

Simply run your Chrome app like this:

/path/to/nw.exe <folder path of the manifest.json file>

Except for a very few things such as intercommunication between my app and a helper extension, everything works as expected with zero changes even though it is an advanced app with nearly 3000 lines of JS code.

For new cross platform apps, Electron might be the better choice (I have actually no idea) but for existing Chrome apps I would say that nw.js is really something you should consider.

Hope this can help someone in the same position.

Share:
12,384

Related videos on Youtube

miu
Author by

miu

The web and the cloud are my passion! I also ❤️ Linux, the command line, Kubernetes, Distributed Systems, Python, JavaScript / TypeScript and thongs!

Updated on June 28, 2022

Comments

  • miu
    miu almost 2 years

    I want to program a desktop app in javascript (with web technologies) and looked for a comparison between Electron and Chrome Apps.

    Everything I need seems to be possible with Chrome Apps, but there's a big hype around Electron/NW.js. What are the advantages of Electron? Is it due to the large amount of Node packages?

    I think the functional differences are clear to me.

    Pros and cons like:

    + Chrome Apps can run on Chrome OS  
    - Chrome Apps needs an installed Chrome Browser
    ...
    

    UPDATE 2016-08-20:

    As Eduardo pointed out, Google announced that they'll discontinue Chrome Apps for all platforms except ChromeOS. So I think the answer to this question is obvious now.

    For all of you who developed a Chrome App and are interested in migrating it to the web here's a guide from Google: https://developers.chrome.com/apps/migration

    Or, as Google also mentioned, you migrate it to Electron or NW.js.

    • Mjh
      Mjh over 8 years
      Chrome apps need browser to run, Electron / NW.js bundle everything and you get an executable file that your users can just doubleclick and it works, no Chrome needed. An example of such a program is popcorn time.
    • Albert James Teddy
      Albert James Teddy almost 8 years
      If you choose not to use chrome apps, here is an interesting blog post about differences between Electron and NW.js tangiblejs.com/posts/nw-js-and-electron-compared-2016-editio‌​n
  • FlipOne
    FlipOne almost 8 years
    You mentioned about Chrome apps being great for Google Drive use in relation to Electron apps. Is it possible to, or are there any special requirements that will, enable an Electron app to be stored in and/or launched from Google Drive (for example, in packaging the Electron app)?
  • miu
    miu almost 8 years
    Thanks, that was really helpful! Thus, I would choose Electron.
  • Eduardo
    Eduardo almost 8 years
    @Xan I couldn't find any resources pointing our that you can self-host Chrome Apps. I can't verify if that's true or not
  • Xan
    Xan almost 8 years
    Hmm. I tested it and it seems that my assumption is wrong. Retracting my objection and deleting the original comment.
  • Udo G
    Udo G almost 8 years
    I'd add that only Chrome Apps will also run on a Chromebook