From b7e866909a1c96be5965c57289af551869dce2aa Mon Sep 17 00:00:00 2001 From: Sampath Kumar Krishnan Date: Fri, 24 Apr 2020 23:26:06 +0530 Subject: Implement modifyRequestHeaders for Hangouts and document (#137) Co-Authored-By: Mahadevan Sreenivasan --- uncompressed/hangoutschat/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'uncompressed/hangoutschat/index.js') diff --git a/uncompressed/hangoutschat/index.js b/uncompressed/hangoutschat/index.js index 95e7fa5..819e06b 100644 --- a/uncompressed/hangoutschat/index.js +++ b/uncompressed/hangoutschat/index.js @@ -3,6 +3,16 @@ var os = require('os') // just pass through Franz module.exports = Franz => class HangoutsChat extends Franz { + // Method to add headers to requests from Hangouts Chat's webview + modifyRequestHeaders() { + return [{ + headers: { 'origin': 'https://chat.google.com' }, + requestFilters: { + urls: ['*://*/*'] + } + }] + } + overrideUserAgent() { if (os.platform() == 'linux') return "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" -- cgit v1.2.3-54-g00ecf