aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/sessionHandler.ts
blob: 0c6d23f235a1e4c4fadbfef3fc878e7a20149d77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const debug = require('debug')('Ferdi:Plugin:SessionHandler');

export class SessionHandler {
  async releaseServiceWorkers() {
    try {
      const registrations =
        await window.navigator.serviceWorker.getRegistrations();
      for (const registration of registrations) {
        registration.unregister();
        debug('ServiceWorker unregistered');
      }
    } catch (error) {
      debug(error);
    }
  }
}