aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/sessionHandler.ts
blob: e38368a185aa7a631c6cbdafcdde22f1d262e609 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const debug = require('debug')('Ferdium: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);
    }
  }
}