Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isPersistentBackground #23

Closed
fregante opened this issue Nov 10, 2023 · 2 comments · Fixed by #27
Closed

Add isPersistentBackground #23

fregante opened this issue Nov 10, 2023 · 2 comments · Fixed by #27
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fregante
Copy link
Owner

Event pages and service workers can be unloaded at any time. There should be a detection to tell a persistent background page from an unloadable one.

Does isPersistentBackground make sense? isEventPage could work but I'd prefer a detection that lumps event pages and service workers.

@fregante fregante added enhancement New feature or request help wanted Extra attention is needed labels Nov 10, 2023
@fregante
Copy link
Owner Author

const background = chrome.runtime.getManifest().background!;
const isPersistentBackgroundPage =
	!('service_worker' in background)
		&& background.persistent !== false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant