summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrealgagu2020-03-25 10:20:13 -0500
committerfrealgagu2020-03-25 10:20:13 -0500
commit800d8e355aafe722261ea074d987936b65102546 (patch)
treebac6402064489af286b970ef639e13ba92e3ae6d
parent2e524141903154015a50d0491aae31a79767ae79 (diff)
downloadaur-800d8e355aafe722261ea074d987936b65102546.tar.gz
Adding unzip make dependency and modifying inject.js to support multiple languages with a single regex.
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD11
-rw-r--r--whatsapp-nativefier-inject.js28
-rw-r--r--whatsapp-nativefier.desktop2
4 files changed, 24 insertions, 24 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 85e83b9e866..72e32cebb98 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = whatsapp-nativefier
pkgdesc = WhatsApp desktop built with nativefier (electron)
- pkgver = 0.4.1296
+ pkgver = 0.4.1307
pkgrel = 1
url = https://web.whatsapp.com
arch = armv7l
@@ -9,6 +9,7 @@ pkgbase = whatsapp-nativefier
license = custom
makedepends = imagemagick
makedepends = nodejs-nativefier
+ makedepends = unzip
depends = gtk3
depends = libxss
depends = nss
@@ -17,8 +18,8 @@ pkgbase = whatsapp-nativefier
source = whatsapp-nativefier.desktop
source = whatsapp-nativefier-inject.js
sha256sums = 3899581abcfed9b40b7208bbbca8bdbfe3ae9655980dbf55f04dec9cb3309f27
- sha256sums = 7dd411689d348d2ca7ccc8e1791054a360519a4a77da3d863be114b6f8b28cbb
- sha256sums = 621c7f3fa6f5169a7e43c85d5dd4ba02a07536745e76875303d3d15c2e872736
+ sha256sums = bad0489ae519bc78afab3d226966691feede8bcedf58025af1b171215ae51423
+ sha256sums = 9c1b04a35308fafeecb747a5a552922a97557ec22c70dd0ffb0bbcb460be824e
pkgname = whatsapp-nativefier
diff --git a/PKGBUILD b/PKGBUILD
index 659035b5faf..94a6e6d91fe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Fredy GarcĂ­a <frealgagu at gmail dot com>
pkgname=whatsapp-nativefier
-pkgver=0.4.1296
+pkgver=0.4.1307
pkgrel=1
pkgdesc="WhatsApp desktop built with nativefier (electron)"
arch=("armv7l" "i686" "x86_64")
@@ -9,15 +9,16 @@ url="https://web.${pkgname%-nativefier}.com"
license=("custom")
depends=("gtk3" "libxss" "nss")
optdepends=("libindicator-gtk3")
-makedepends=("imagemagick" "nodejs-nativefier")
+makedepends=("imagemagick" "nodejs-nativefier" "unzip")
source=(
"${pkgname}.png"
"${pkgname}.desktop"
- "${pkgname}-inject.js")
+ "${pkgname}-inject.js"
+)
sha256sums=(
"3899581abcfed9b40b7208bbbca8bdbfe3ae9655980dbf55f04dec9cb3309f27"
- "7dd411689d348d2ca7ccc8e1791054a360519a4a77da3d863be114b6f8b28cbb"
- "621c7f3fa6f5169a7e43c85d5dd4ba02a07536745e76875303d3d15c2e872736"
+ "bad0489ae519bc78afab3d226966691feede8bcedf58025af1b171215ae51423"
+ "9c1b04a35308fafeecb747a5a552922a97557ec22c70dd0ffb0bbcb460be824e"
)
build() {
diff --git a/whatsapp-nativefier-inject.js b/whatsapp-nativefier-inject.js
index 828fb8cd138..c0921a0e4f9 100644
--- a/whatsapp-nativefier-inject.js
+++ b/whatsapp-nativefier-inject.js
@@ -1,17 +1,15 @@
-const regexes = [
- // en
- /whatsapp works with.*to use whatsapp.*update/i,
- // es
- /whatsapp funciona con.*para usar whatsapp.*actualiza/i,
- // pt
- /o whatsapp funciona com.*para utilizar o whatsapp.*atualize/i,
- // ge
- /whatsapp funktioniert mit.*um whatsapp zu benutzen.*aktualisiere/i
-]
+// ==UserScript==
+// @include https://web.whatsapp.com/
+// ==/UserScript==
-for (const regex of regexes) {
- if (document.body.innerText.replace(/\n/g, ' ').search(regex) !== -1) {
- navigator.serviceWorker.getRegistration().then(function (r) { r.unregister(); document.location.reload() });
- return;
- }
+// Quirk for WhatsApp Web, based on:
+// https://github.com/jiahaog/nativefier/issues/719
+
+"use strict";
+
+if (document.querySelector("a[href='https://support.google.com/chrome/answer/95414']")) {
+ navigator.serviceWorker.getRegistration().then((registration) => {
+ registration.unregister();
+ document.location.reload();
+ });
}
diff --git a/whatsapp-nativefier.desktop b/whatsapp-nativefier.desktop
index 6fef56f2286..daba9a6c815 100644
--- a/whatsapp-nativefier.desktop
+++ b/whatsapp-nativefier.desktop
@@ -4,7 +4,7 @@ Comment=WhatsApp desktop built with nativefier (electron)
Exec=whatsapp-nativefier
Icon=whatsapp-nativefier
Encoding=UTF-8
-StartupWMClass=whats-app-nativefier-d52542
+StartupWMClass=whatsapp-nativefier-d40211
Terminal=false
StartupNotify=true
Type=Application