From ee5695b4e9c56a05e2d837f397bdd6df9aeabc62 Mon Sep 17 00:00:00 2001 From: iconeb Date: Wed, 23 Aug 2023 17:58:33 +0200 Subject: [PATCH] Allow gchat login page (#403) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Oliveira Co-authored-by: Vijay A --- recipes/hangoutschat/package.json | 2 +- recipes/hangoutschat/webview.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/hangoutschat/package.json b/recipes/hangoutschat/package.json index 614cf9076..bea0afbaf 100644 --- a/recipes/hangoutschat/package.json +++ b/recipes/hangoutschat/package.json @@ -1,7 +1,7 @@ { "id": "hangoutschat", "name": "Hangouts Chat", - "version": "1.7.0", + "version": "1.8.0", "license": "MIT", "aliases": [ "google-chat", diff --git a/recipes/hangoutschat/webview.js b/recipes/hangoutschat/webview.js index 75c53d059..7f2acf2cb 100644 --- a/recipes/hangoutschat/webview.js +++ b/recipes/hangoutschat/webview.js @@ -5,6 +5,15 @@ function _interopRequireDefault(obj) { const _path = _interopRequireDefault(require('path')); module.exports = Ferdium => { + // if the user is on googlechat landing page, go to the login page. + if ( + location.hostname === 'workspace.google.com' && + location.href.includes('products/chat/') + ) { + location.href = + 'https://accounts.google.com/AccountChooser?continue=https://chat.google.com/?referrer=2'; + } + // class corresponding to the red badge that is visible for direct messages const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU';