From 143583b74f69bb69ccddb6cb2fa7ae744bc76e72 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 1 Apr 2020 08:34:45 +0200 Subject: Don't set Mac UA on Linux for Google services If we set the Mac UA on Linux, then various shortcuts will change to Mac ones - i.e. Ctrl + K to create a link in GMail will stop work, Ctrl + Enter to send an email in GMail and others. Only set the Mac UA when not running on Linux. --- uncompressed/hangoutschat/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'uncompressed/hangoutschat/index.js') diff --git a/uncompressed/hangoutschat/index.js b/uncompressed/hangoutschat/index.js index 560a173..95e7fa5 100644 --- a/uncompressed/hangoutschat/index.js +++ b/uncompressed/hangoutschat/index.js @@ -1,7 +1,12 @@ +var os = require('os') + // just pass through Franz module.exports = Franz => class HangoutsChat extends Franz { overrideUserAgent() { - return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; + 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"; } }; -- cgit v1.2.3-70-g09d2