From c15c01db45bd912e4f0daa48dab72633be761b29 Mon Sep 17 00:00:00 2001 From: Mahadevan Sreenivasan Date: Mon, 1 Jun 2020 22:47:41 +0530 Subject: fix: replace user-agent by removing any Ferdi|Electron strings and trim() the end result --- all.json | 4 ++-- archives/gmail.tar.gz | Bin 65243 -> 65219 bytes uncompressed/gmail/index.js | 16 +++++++++++----- uncompressed/gmail/package.json | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/all.json b/all.json index b76b263..b0bd43b 100644 --- a/all.json +++ b/all.json @@ -254,10 +254,10 @@ }, { "author": "Stefan Malzner ", - "featured": true, + "featured": false, "id": "gmail", "name": "Gmail", - "version": "1.3.1", + "version": "1.3.2", "icons": { "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/gmail/icon.png", "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/gmail/icon.svg" diff --git a/archives/gmail.tar.gz b/archives/gmail.tar.gz index 59b6eed..fe2cb06 100644 Binary files a/archives/gmail.tar.gz and b/archives/gmail.tar.gz differ diff --git a/uncompressed/gmail/index.js b/uncompressed/gmail/index.js index 4087aa3..60f0971 100644 --- a/uncompressed/gmail/index.js +++ b/uncompressed/gmail/index.js @@ -2,10 +2,16 @@ var os = require('os') module.exports = Franz => class Gmail extends Franz { - overrideUserAgent() { - if (os.platform() == 'linux') - return "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" - else - return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; + modifyRequestHeaders() { + return [ + { + headers: { + 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g,"").trim(), + }, + requestFilters: { + urls: ['*://*/*'], + } + } + ] } }; diff --git a/uncompressed/gmail/package.json b/uncompressed/gmail/package.json index d7191e9..0048e49 100644 --- a/uncompressed/gmail/package.json +++ b/uncompressed/gmail/package.json @@ -1,7 +1,7 @@ { "id": "gmail", "name": "Gmail", - "version": "1.3.1", + "version": "1.3.2", "description": "Gmail", "main": "index.js", "author": "Stefan Malzner ", -- cgit v1.2.3-70-g09d2