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

fix: init on browser startup #109

Closed
wants to merge 1 commit into from
Closed

Conversation

@ErikBjare
Copy link
Member

Thanks for this, but I'm not so sure that this is the issue since it has been set like that for a very long time (git blame says 7 years...), long before Mozilla pulled the previously working version. Have you tested it for an extended period?

If it does indeed solve/workaround the issue, we need to investigate why that is, because it should work with "persistent": false.

These docs on migrating to event pages state:

Implementing non-persistent background scripts will greatly reduce the resource cost of your extension. Most extension functionality can be supported by an event based background script. Only under rare circumstances should an extension have a persistent background, as they constantly consume system resources and can cause a strain on lower-powered devices.

You wrote:

persistent: true is also the default behavior when unset. And I don't know of any extension that uses persistent: false.

These docs state:

The only occasion to keep a background script persistently active is if the extension uses chrome.webRequest API to block or modify network requests. The webRequest API is incompatible with non-persistent background pages. By default, "persistent" is set to true.

According to this, since we do not use the webRequest API, we should not need persistent background scripts (unlike ublockOrigin, ClearURLs, Cookie-AutoDelete, I presume).

@Aziks0
Copy link
Author

Aziks0 commented May 16, 2023

I've scratched my head around this for quite some time now, and honestly... I don't know.

The two things that made it work are:

  • persistent: true
  • removing the static/installed.js file from the list of background scripts.

It doesn't make sense.

And yes, you're right, it only appears in recent versions of firefox.

@ErikBjare
Copy link
Member

removing the static/installed.js file from the list of background scripts.

Oh really? Could you give the changes in #110 a shot? It removes the need for installed.js.

@Aziks0
Copy link
Author

Aziks0 commented May 16, 2023

#110 works perfectly

@ErikBjare
Copy link
Member

ErikBjare commented May 23, 2023

I think #110 should have resolved the issue. Thanks for digging this up though, good stuff!

@ErikBjare ErikBjare closed this May 23, 2023
@Aziks0 Aziks0 deleted the patch-1 branch May 23, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firefox data is not shown in visualizations
2 participants