diff options
Diffstat (limited to 'recipes/whatsapp/webview.js')
-rw-r--r-- | recipes/whatsapp/webview.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index 8087b08..eaaf2c2 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js | |||
@@ -3,20 +3,8 @@ const _path = _interopRequireDefault(require('path')); | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
4 | 4 | ||
5 | window.addEventListener('beforeunload', async () => { | 5 | window.addEventListener('beforeunload', async () => { |
6 | try { | 6 | Ferdi.clearStorageData(['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']); |
7 | const { session } = Ferdi.getCurrentWebContents(); | 7 | Ferdi.releaseServiceWorkers(); |
8 | session.flushStorageData(); | ||
9 | session.clearStorageData({ | ||
10 | storages: ['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb'], | ||
11 | }); | ||
12 | const registrations = await window.navigator.serviceWorker.getRegistrations(); | ||
13 | registrations.forEach(r => { | ||
14 | r.unregister(); | ||
15 | console.log('ServiceWorker unregistered'); | ||
16 | }); | ||
17 | } catch (err) { | ||
18 | console.err(err); | ||
19 | } | ||
20 | }); | 8 | }); |
21 | 9 | ||
22 | module.exports = Ferdi => { | 10 | module.exports = Ferdi => { |