Save 37% off PRO during our Black Friday Sale! »

Periodic Background Sync

1ff811939fd0923df8321ec6d8bf9d4b?s=47 Jxck
April 17, 2020

Periodic Background Sync

LT about periodic background sync at #remo_study

1ff811939fd0923df8321ec6d8bf9d4b?s=128

Jxck

April 17, 2020
Tweet

Transcript

  1. Periodic Background Sync Periodic Background Sync

  2. None
  3. Background Sync self.on('sync', (e) => { // retry failed request

    while // offline in background })
  4. Periodic Background Sync self.on('periodic-sync', (e) => { // periodically refresh

    contents // up to date in background. })
  5. Use Case - Podcast Feed Update

  6. // register PBS const name = 'periodic-background-sync' const status =

    await navigator.permissions.query({name}) if (status.state === 'granted') { await registration.periodicSync.register('refresh', { minInterval: 12 * 60 * 60 * 1000 // 12h }) }
  7. Security Consideration

  8. #4: 156.74.xxx.xxx #1: 14.102.xxx.xxx #2: 81.177.xxx.xxx #3: 24.152.xxx.xxx Background Sync

    Tracking also • crypto mining • bot net
  9. Known Network

  10. Permission In Chrome

  11. Permission Model Permission Dialog ? User Gesture ? Feature Policy

    ? Add to Home Screen !!
  12. Native App Permission -> Install Web App Permission -> Install

  13. Restriction In Chrome

  14. • Periodic depends on site-engagement. • Only fire under known

    network.
  15. Site Engagement

  16. Periodic Background Sync enables... • Installed App via A2HS •

    Enough Site-Engagement • Connected to Known Network • Android Chrome only
  17. Work in progress...

  18. None