aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/sessionHandler.ts
blob: a2906113d3996e2c84d04e86b369050af50403a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed
// 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();
        console.log('ServiceWorker unregistered');
      }
    } catch (error) {
      console.log(error);
    }
  }
}