close
Skip to content

Manifest v3 background scripts should not be killed when there are active listeners #518

@ParticleCore

Description

@ParticleCore

My extension requires a very important API to be always active in the background script in order to intercept and modify web requests as early as possible, and during the entire session of that page.

  • This extension is simply built to work on www.youtube.com
  • It requires modifying certain aspects of the page, and files it loads, as early as possible and whenever new versions are loaded since they can expire. To achieve this, the background script makes use of the browser.webRequest.onBeforeRequest API
  • YouTube is not a typical website in which each page is loaded as a brand new page, instead it loads only once and then modifies the page contents as the user navigates, or interacts with the page, so one typical page session can go on for hours
  • YouTube often updates their script files, which means that while the user is navigating for a long time some of those files can expire and new ones are loaded.
  • For this reason the extension must be always active in order to intercept newer file versions that are loaded way past the first 30s of when the page was initially opened.

With the new v3 implementation of non-persistent background scripts, the extension is no longer capable of working at all past the first 30s window, at which time users that navigate or interact with the page will no longer have anything related to the extension working correctly.

As a result of this, I am forced to revert the manifest back to v2 and I sincerely hope that this issue can be resolved, otherwise it will be the death of this and many other extensions in the same predicament.

Why can't we keep background scripts alive while there are active listeners is beyond me, most of those permissions can only be used by background scripts too so even if we wanted to migrate them to content-scripts we just can't. At the very least, provide the option for the user to authorize an extension to run permanently on the background since it is all moving towards user-based permission models.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions