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 --- uncompressed/gmail/index.js | 16 +++++++++++----- uncompressed/gmail/package.json | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'uncompressed') 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