Last updated
Last updated
Terminate when not in use
need to persist application states
Use and APIs
and are only avilable through an .
need to use alarms
allow start, run, and terminate repeatedly
Listen to events like typing in url and stuff
Don't register async, it might not work
Communicate with content script to activate page actions and has access to chrome apis
Chrome terminates a service worker:
After 30 seconds of inactivity. Receiving an event or calling an extension API resets this timer.
When a single request, such as an event or API call, takes longer than 5 minutes to process.
When a response takes more than 30 seconds to arrive.
DOM-based timers, such as window.setTimeout()
or window.setInterval()
, are not honored
Then add a listener.
consider bad practice, butttt also in Chrome docs so...
Instead, use the .