diff options
Diffstat (limited to 'whatsapp-nativefier-inject.js')
-rw-r--r-- | whatsapp-nativefier-inject.js | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/whatsapp-nativefier-inject.js b/whatsapp-nativefier-inject.js index d31b187a83c4..81bba8bafeae 100644 --- a/whatsapp-nativefier-inject.js +++ b/whatsapp-nativefier-inject.js @@ -1,28 +1,7 @@ -// ==UserScript== -// @include https://web.whatsapp.com/ -// ==/UserScript== - -// Quirk for WhatsApp Web, based on: -// https://github.com/jiahaog/nativefier/issues/719 - -"use strict"; - -var id = setInterval(bypass, 50); -function bypass() { - console.log("Checking for 'Update browser' message..."); - if (document.querySelector("a[href='https://support.google.com/chrome/answer/95414']")) { - console.log("Bypassing 'Update browser' message..."); - navigator.serviceWorker.getRegistration().then((registration) => { - registration.unregister(); - document.location.reload(); - console.log("'Update browser' message bypassed."); - clearInterval(id); +if ('serviceWorker' in navigator) { + caches.keys().then(function (cacheNames) { + cacheNames.forEach(function (cacheName) { + caches.delete(cacheName); + }); }); - } } -window.setTimeout( - function() { - console.log("No 'Update browser' message found after 5 seconds."); - clearInterval(id); - }, 5000 -); |