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

[FEATURE REQUEST] Persistent ServiceWorker to run setInterval() #1624

Closed
wmbenedetto opened this issue Jan 15, 2022 · 1 comment
Closed

[FEATURE REQUEST] Persistent ServiceWorker to run setInterval() #1624

wmbenedetto opened this issue Jan 15, 2022 · 1 comment

Comments

@wmbenedetto
Copy link

I'm the developer of StayFocusd, a popular Chrome extension that blocks time-wasting websites. It has been around since Jan 2010 and has 625,000 users, and the Manifest V3 switch from background pages to ServiceWorkers is going to kill the app.

The use-case is pretty simple. StayFocusd users add urls to a Blocked Sites list. They also have a Max Time Allowed for the day, say, 10 minutes. Whenever they are on a blocked site, StayFocusd decrements the Max Time Allowed. Once the Max Time Allowed hits zero, the blocked sites are blocked for the rest of the day.

To do this, StayFocusd keeps track of the url in the active tab. A setInterval() runs once per second and checks whether the current url is on the Blocked Sites list. If it is, it decrements the Max Time Allowed by 1 second.

As I understand it, the switch to ServiceWorkers means that there is no way to run a persistent setInterval(). That means there is no way for me to decrement the Max Time Allowed counter as users browse a blocked site, which essentially bricks my extension.

I understand some of the security and privacy reasons for switching to ServiceWorkers, and for them not being persistent. But please consider the legitimate use-cases like mine that are being affected by this. It seems like there's a need for a PersistentServiceWorker, possibly with a higher level of permissions that a user needs to opt into.

@jakearchibald
Copy link
Contributor

Previous discussion #1558

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

No branches or pull requests

2 participants