javascript - Does service worker runs on background even if browser is closed? -
i see push notification facebook web in chrome when open chrome. know notification sent through service worker. wondering whether background sync goes on though browser closed or on opening chrome these service-worker sync process started , start sending push notification.
first thing depends on platform. understanding of chrome is:
on desktop platforms windows , mac os x browser needs have background process running service worker able run. on mac os x quite easy detect browser can have no windows open browser still has glowing dot beneath it.
on mobile platforms it's easier listen events , handle them in efficient manner, in these cases platform can wake browser handle corresponding events.
the above applies service worker api's.
on desktop: if browser completely closed service workers can not run , not dispatch events (i.e. no push or background sync events)
on mobile: events still dispatched (i.e. background sync trigger when users device comes online , push received , cause push event).
Comments
Post a Comment