Skip to content

binfalse/matrix-gchat-bridge-login-cookie-generator

Repository files navigation

Matrix-GChat Bridge Login Cookie Generator

Matrix-GChat Bridge Login Cookie Generator Icon

Little web extension for Firefox and Chromium based browsers to generate the login-cookie command that mautrix' Google Chat bridge needs for authentication. Check GChat login-cookie generator for mautrix' puppeting bridge @ binfalse for more information.

Install

The web extension is available from Firefox Logo Mozilla's AddOn directory and the Chrome Logo Chrome Web Store.

Usage

  1. Install the web extension for your browser
  2. login to Google Chat
  3. click the extension's icon and then click the copy button in the popup
  4. paste the contents into the matrix conversation with the Google Chat bridge

Why and How?

Since some time the bridge users need to re-authenticate the Google Chat connection with some login-cookie command. For that you'd need to login to the Google Chat with a browser, check the browser's cookies and copy 5 of the Google cookies to a json object like that:

{
  "compass": "dynamite-ui=...",
  "ssid": "...",
  "sid": "...",
  "osid": "...",
  "hsid": "..."
}

which must then be sent to the Google Chat bridge bot.

-> check the full mautrix authentication manual

Anyway, that must be done like every other week and is of course super annoying...

Thus, I wrote that little web extension to automates the process. Just click the little new icon in the browser's toolbar after you signed in to the Google Chat and it will check the Google cookies and create the necessary json object for you \o/

Build

Unfortunately, at the moment Firefox basically only supports web extensions version 2 while Chromium already pressures to web extensions version 3. Fortunately, this web extension is simple enough that those two versions only differ in the manifest format and that's why there are two manifests: manifest-v2.json for Firefox and manifest-v3.json for Chromium.

To build a new version, just create a link manifest.json to one of the manifest version and zip everything into an archive.