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

Non-persistent background script #80

Merged
merged 6 commits into from
Nov 6, 2022
Merged

Non-persistent background script #80

merged 6 commits into from
Nov 6, 2022

Conversation

airtower-luna
Copy link
Owner

Also called "Event Page". See this Mozilla blog entry for the advantages. I'm not sure if there's a lot of resource saving in this specific case: Expressions have to be loaded on resume, which is a it's memory saving vs. CPU load trade-off. But the crash recovery is desirable, and it's a step towards Manifest v3 that I can take now.

Summary of the required changes:

  • Use local storage instead of messaging to toggle enabled/disabled state for modifications.
  • Ensure config is reloaded if undefined. This happens after resume, because variables are lost when the page is unloaded.

Key changes:

* Use local storage instead of messaging to enable/disable
  modification

* Ensure config has been loaded before being used in request event
  handler
All versions since 0.5 (published January 2019) did that cleanup, so
no current users should still have that. And if anyone reactivates an
ancient browser profile it shouldn't cause trouble either.
Previously an unset "mod_enable" value in local storage would lead to
an empty button.
There's nothing async in it in the current form, so the result is only
an unnecessary "await" in the caller.
@airtower-luna airtower-luna added the enhancement New feature or request label Nov 6, 2022
@airtower-luna airtower-luna added this to the Manifest v3 milestone Nov 6, 2022
@airtower-luna airtower-luna merged commit 0815a0f into main Nov 6, 2022
@airtower-luna airtower-luna deleted the non-persistent-bg branch November 6, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant