Electron apps are infamous for being resource-intensive. They use noticeably more RAM and battery than their corresponding website versions (especially Electron vs Orion).
As a particular, on any given day, the 12-hour battery consumption of Discord is about 2x that of IntelliJ (a java-based IDE) and 4x that of Firefox or Orion. It is consistently in my "Apps using significant battery consumption". Across all platforms, Discord's RAM consumption rivals Firefox and IntelliJ.
I am aware that Discord is a particularly bad example. However, other Electron apps like Spotify, VS Code, and Mailspring display many of these tendencies too 🙁
For Electron apps that have web versions (Discord/Spotify), Progressive Web Apps serve as a potential alternative to their Electron versions.
They offer:
- Shared resources with the main browser process
- Background service workers & notifications
- Seperate windows, able to be minimized indepedentently of the main browser
However, as I understand it, progressive web apps have to be enabled by the website author themselves. Discord has chosen not to do that.
What would be absolutely amazing, is if we could have some of these PWA features enabled for normal sites 😀
In particular, I would like to have Discord enabled in the background (in a separate user-visible window) and specifically instructed to use low battery mode (independent of the main browser)
A lot of this is probably hard. I'm basically asking you to make Orion support "background sites" as an alternative to Electron. Something like Progressive Web Apps, even for websites that weren't designed for it in the first place 😮
However, think of the potential! Even if users don't choose to use Orion as their main browser, they are almost certain to be tempted by this feature. Who in their right minds wouldn't want a lighter alternative to Discord & Spotify? 🚀
This can probably be split up into several different steps. Most of these don't have to be done in any particular order:
- Beginning to isolate certain (user-requested) sites from others.
- Maybe not full separate windows, but at least make the "Low Battery Mode" website per-site 🙂
- Support for service workers. Firefox has these, despite not supporting PWA in full.
- Support for running these sites minimized, visually separate from regular tabs
- The UI of "closing discord" should be separate from "closing a tab", even if the implementation is the same 😃
- I close tabs aggressively, but I often have to be careful not to close the discord tab
- Supporting some subset of PWA features, even if the site wasn't designed for it (Desktop Notifications?)
- In particular, PWA requires service workers even when the website is disconnected and off. I'm suggesting never actually closing the underlying tab, just hiding it from the user. This would allow the regular notification API to work even without a background service worker (I'm looking at you Discord)
I've mentioned Progressive Web Apps support, but really this is somewhat of a different feature.
Unlike PWA support, the implementation of this feature doesn't really have to be separate from that of a regular tab. The main request is a change in UI.
These sites could be preconfigured in preferences, the only real requirement is that they have
- Independent "Low Battery Mode"
- Closed independently of regular tabs (visually in the background while semantically still a tab).
This wouldn't be a full-featured alternative to Electron or PWA, but it would significantly improve the UI (and resource usage) of using website apps like Discord & Spotify.
Let me know what you think 😃