Honestly, Mark, it has been immediately relevant for a lot of extension devs for a long time.
This isn't the first time the issue has been brought up here, but we have been asked to offer examples so that the unimaginative can finally understand why it's an issue.
If we offer a wide enough variety of examples frequently enough, then perhaps we'll get some softening on the parts of MV3 that are infeasible for production applications.
There are some janky workarounds, sure... but each of these workarounds is essentially just making a "fake" background.js page:
- Extending the service worker by making it await an indefinite promise and demanding that it do work every 5 minutes to stay awake. Service worker is now effectively background.js.
- Opening a new browser tab and/or window and instructing the user not to close it, then using this window/tab to do all of the extension's background processing; Just a background.js with worse user experience.
- Injecting into all domains and trying to make some sort of overengineered bug-prone nonperformant shared state-management between content.js files, delegating one of the content scripts to handle processes that would have been handled in background.js.
As w0xx0m has pointed out in the past, this "service worker"
issue (and the problems it intends to solve)
is a relic of the past, originally proposed as a solution to problems that existed almost 8 years ago. The device landscape has changed significantly since then, and it doesn't seem that Google has acknowledged this. For example, in 2021, a budget $205 Chromebook comes with 4GB of RAM (that it doesn't even have to share with a memory-hungry OS like Windows)
, and mid to mid-low tier Windows laptops around the $400 mark tend to ship with 8GB
. Google is fundamentally seeking to resolve problems that arguably no longer exist. Mind you, a single instance of their own New Tab Page in an empty profile takes 35MB RAM on my mac, and Gmail takes about 200MB RAM per-tab. Within these RAM-plentiful circumstances we live under today, Google has been "generous"
enough to offer us 2.86% of the RAM usage of a New Tab Page for the brain of our extensions to persist in memory. If the user so much as opens a second Gmail tab, they put memory pressure on their device that's 200x the maximum we can persist.
I really don't know what a good solution is to any of this if Google doesn't budge -- It feels like they're making a platform that will force all of us to bypass its intended outcomes.