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

Firefox: Prepare for non-persistent background page #2969

Open
gorhill opened this issue Nov 20, 2023 · 2 comments
Open

Firefox: Prepare for non-persistent background page #2969

gorhill opened this issue Nov 20, 2023 · 2 comments
Labels
Firefox specific to Firefox

Comments

@gorhill
Copy link
Member

gorhill commented Nov 20, 2023

Description

Admittedly, I am a bit late at this.

See:

To do:

  • Verify and fix as needed that auxiliary pages are behaving properly when the uBO background page is terminated
  • Evaluate how port closing affects content scripts -- this might be the most problematic aspect of being non-persistent
    • This means the generic cosmetic filtering surveyor may be interrupted even though there still could be matching generic cosmetic filters to come
  • Optimize timing to generate a selfie, which will be even more key to quickly load back uBO's process into memory
  • Evaluate using storage.session to further speed up load sequence
@gorhill gorhill added the Firefox specific to Firefox label Nov 20, 2023
@rtx2080tix

This comment was marked as off-topic.

@gorhill
Copy link
Member Author

gorhill commented Nov 30, 2023

gorhill added a commit to gorhill/uBlock that referenced this issue Dec 4, 2023
Related issue:
uBlockOrigin/uBlock-issues#2969

Changes:

Use browser.alarms to trigger selfie creation. Presence of a selfie
improve markedly time to readiness when uBO is unsuspended.

Mirror content of storage.local to (in-memory) storage.session for
faster load to readiness when uBO is ususpended.
gorhill added a commit to gorhill/uBlock that referenced this issue Feb 28, 2024
Turns out it's currently the fastest among the three currently
implemented (Cache, browser.storage.session, indexedDB). Possibly
because indexedDB can natively persist structure-cloneable data,
something uBO can now benefit with the work on abstracting away
the limitations of various storages being limited to persist only
text or JSON data.

Related issue:
uBlockOrigin/uBlock-issues#2969
gorhill added a commit to gorhill/uBlock that referenced this issue Feb 29, 2024
Related issue:
uBlockOrigin/uBlock-issues#2969

Related previous commit:
5a338b7210

The save-to-storage period is back to being around ~4 minutes, but
now browser.storage.session API is used to keep track of request
stats should the extension be suspended before the period elapse.
gorhill added a commit to gorhill/uBlock that referenced this issue Mar 2, 2024
Related issue:
uBlockOrigin/uBlock-issues#2969

Additionally, modified default timing values for asset updater and
selfie creation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Firefox specific to Firefox
Projects
None yet
Development

No branches or pull requests

2 participants