summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredy García2021-10-28 21:11:32 -0500
committerFredy García2021-10-28 21:11:32 -0500
commitceeefcd4326b7c8ffd136821dbebf83ac06b3a0b (patch)
tree1f6e8c5b2df43a4eb0b2723564895a0096946076
parent5c98f112c6b2fd9d8fcbff9b331cf3378d1a3940 (diff)
downloadaur-ceeefcd4326b7c8ffd136821dbebf83ac06b3a0b.tar.gz
Adding unregistration of service worker to inject.js
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--whatsapp-nativefier-inject.js25
3 files changed, 27 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f442eafea9e..ea95a3261ba 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = whatsapp-nativefier
pkgdesc = WhatsApp desktop built with nativefier (electron)
- pkgver = 2.2138.10
+ pkgver = 2.2142.11
pkgrel = 1
url = https://web.whatsapp.com
arch = armv7l
@@ -19,6 +19,6 @@ pkgbase = whatsapp-nativefier
source = whatsapp-nativefier-inject.js
sha256sums = 3899581abcfed9b40b7208bbbca8bdbfe3ae9655980dbf55f04dec9cb3309f27
sha256sums = bad0489ae519bc78afab3d226966691feede8bcedf58025af1b171215ae51423
- sha256sums = f46bdc1adc9868d13b4f0809667cd5a9b1a6e5e47bc25b570f062d7072d0f942
+ sha256sums = c8486653c651e66d0da78c08dbf46dd5fa25f68daa500a369e09e557a14cc295
pkgname = whatsapp-nativefier
diff --git a/PKGBUILD b/PKGBUILD
index 70d4d17c7ef..dabe9679523 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Fredy García <frealgagu at gmail dot com>
pkgname=whatsapp-nativefier
-pkgver=2.2138.10
+pkgver=2.2142.11
pkgrel=1
pkgdesc="WhatsApp desktop built with nativefier (electron)"
arch=("armv7l" "i686" "x86_64")
@@ -18,7 +18,7 @@ source=(
sha256sums=(
"3899581abcfed9b40b7208bbbca8bdbfe3ae9655980dbf55f04dec9cb3309f27"
"bad0489ae519bc78afab3d226966691feede8bcedf58025af1b171215ae51423"
- "f46bdc1adc9868d13b4f0809667cd5a9b1a6e5e47bc25b570f062d7072d0f942"
+ "c8486653c651e66d0da78c08dbf46dd5fa25f68daa500a369e09e557a14cc295"
)
build() {
diff --git a/whatsapp-nativefier-inject.js b/whatsapp-nativefier-inject.js
index 81bba8bafea..d5ba62be5a0 100644
--- a/whatsapp-nativefier-inject.js
+++ b/whatsapp-nativefier-inject.js
@@ -1,7 +1,28 @@
-if ('serviceWorker' in navigator) {
+console.info("Checking for service worker in navigator...");
+if ("serviceWorker" in navigator) {
+ console.info("Service worker found in navigator.");
+
+ console.info("Checking cache names from service worker...");
caches.keys().then(function (cacheNames) {
+ console.info("CacheNames:", cacheNames);
cacheNames.forEach(function (cacheName) {
- caches.delete(cacheName);
+ console.info("Deleting cache", cacheName, "...");
+ caches.delete(cacheName).then(function (result) {
+ console.info("Cache", cacheName, "deleted:", result);
+ });
});
});
+
+ console.info("Checking service worker registrations...");
+ navigator.serviceWorker.getRegistrations().then(function(registrations) {
+ console.info("Registrations:", registrations);
+ registrations.forEach(function (registration) {
+ console.info("Unregistering registration", registration, "...");
+ registration.unregister().then(function(result) {
+ console.info("Registration", registration, "unregistered:", result);
+ });
+ });
+ });
+} else {
+ console.info("Service worker not found in navigator.");
}