summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrealgagu2020-03-13 11:03:30 -0500
committerfrealgagu2020-03-13 11:03:30 -0500
commit2e524141903154015a50d0491aae31a79767ae79 (patch)
tree2914f914afe442c7d414f23778e9096f9cf6f310
parentf469094def5b4a2a12db2dfcd4a5ca70dfa8c07d (diff)
downloadaur-2e524141903154015a50d0491aae31a79767ae79.tar.gz
Adding support for other languages.
-rw-r--r--whatsapp-nativefier-inject.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/whatsapp-nativefier-inject.js b/whatsapp-nativefier-inject.js
index 428cc9c295d..828fb8cd138 100644
--- a/whatsapp-nativefier-inject.js
+++ b/whatsapp-nativefier-inject.js
@@ -1,2 +1,17 @@
-if (document.body.innerText.replace(/\n/g, ' ').search(/whatsapp works with.*to use whatsapp.*update/i) !== -1)
- navigator.serviceWorker.getRegistration().then(function (r) { r.unregister(); document.location.reload() });
+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
+]
+
+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;
+ }
+}