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

export default 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);
    }
  }
}