Non-persistent background scripts used where possible
Why it matters
A persistent MV2 background script runs continuously from browser launch to shutdown, consuming memory and CPU even when the extension is idle. ISO 25010 performance-efficiency requirements apply: a component that holds resources it does not need is inefficient by definition. Chrome's MV3 mandate migrates all extensions to service workers precisely to eliminate persistent background scripts. Beyond resource consumption, persistent background scripts accumulate state across long sessions, which creates subtle bugs when extension logic assumes a clean startup context. Chrome Web Store's MV3 timeline treats persistent: true in MV2 as a technical debt marker that blocks long-term store access.
Severity rationale
Info because persistent background scripts are a performance and architectural concern rather than a direct security vulnerability, but they indicate non-compliance with Chrome's MV3 roadmap requirements.
Remediation
Migrate to MV3 with a service_worker background in manifest.json. Service workers are non-persistent by design and restart on demand.
{
"manifest_version": 3,
"background": {
"service_worker": "background.js"
}
}
If you must stay on MV2 temporarily, set persistent: false in the background configuration. Rewrite long-running logic to use chrome.alarms instead of setInterval — alarms persist across service worker restarts.
Detection
-
ID:
non-persistent-background -
Severity:
info -
What to look for: Quote the
backgroundconfiguration frommanifest.json. Check forservice_worker(MV3, non-persistent by design) orbackground.scriptswithpersistentflag (MV2). Count the number of long-running timers or intervals in background code. -
Pass criteria: Extension uses MV3 with
service_worker(non-persistent by design), or MV2 withpersistent: falsein background config. At least 1 event-driven pattern is used (listener registration). No more than 0setIntervalcalls with intervals over 30000ms in background scripts. -
Fail criteria: MV2 uses
persistent: true, causing background script to run continuously consuming resources. -
Skip (N/A) when: Extension has no background script.
-
Detail on fail:
"Background script uses persistent: true in MV2 — runs continuously instead of event-driven" -
Remediation: Use event-driven (non-persistent) background scripts in
manifest.jsonto save battery and memory:{ "manifest_version": 3, "background": { "service_worker": "background.js" } }
External references
- iso-25010:2011 · performance-efficiency.resource-utilization — Performance Efficiency — resource utilization
- external · chrome-service-worker — Chrome Extensions MV3: Service Worker (Non-Persistent Background)
Taxons
History
- 2026-04-18·v1.0.0·Initial import from extension-permissions-security·automated