How to stop a background script from going idle in MV3?

Other ways of achieving this were discussed here as well: Impossible to upgrade to manifest v3 for extensions that require constant/persistent listeners