diff options
author | 2020-09-19 19:00:48 +0200 | |
---|---|---|
committer | 2020-09-19 18:00:48 +0100 | |
commit | 2466d5c99758fe54075b2b6c482998e58932c11a (patch) | |
tree | ddfa681819488ff973f3362fc28620755d8c923d /uncompressed/whatsapp/index.js | |
parent | Fix notifications on muted messages for Telegram React (#197) (diff) | |
download | ferdium-recipes-2466d5c99758fe54075b2b6c482998e58932c11a.tar.gz ferdium-recipes-2466d5c99758fe54075b2b6c482998e58932c11a.tar.zst ferdium-recipes-2466d5c99758fe54075b2b6c482998e58932c11a.zip |
Fix UA string for WhatsApp (#275)
* Fixed UA string for Whatsapp
Works for me. Tested on Windows 10.
* bump version of package
* publish package
Diffstat (limited to 'uncompressed/whatsapp/index.js')
-rw-r--r-- | uncompressed/whatsapp/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/uncompressed/whatsapp/index.js b/uncompressed/whatsapp/index.js index 504a70e..a0ff71f 100644 --- a/uncompressed/whatsapp/index.js +++ b/uncompressed/whatsapp/index.js | |||
@@ -2,11 +2,14 @@ | |||
2 | 2 | ||
3 | module.exports = (Franz) => | 3 | module.exports = (Franz) => |
4 | class Messenger extends Franz { | 4 | class Messenger extends Franz { |
5 | overrideUserAgent() { | ||
6 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+( \([^)]+\))?/g, "").trim(); | ||
7 | } | ||
5 | modifyRequestHeaders() { | 8 | modifyRequestHeaders() { |
6 | return [ | 9 | return [ |
7 | { | 10 | { |
8 | headers: { | 11 | headers: { |
9 | 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g,"").trim(), | 12 | 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+( \([^)]+\))?/g, "").trim(), |
10 | }, | 13 | }, |
11 | requestFilters: { | 14 | requestFilters: { |
12 | urls: ['*://*/*'], | 15 | urls: ['*://*/*'], |