Files
RedditBot/extensions/reddit-session-exporter/README.md
T

18 lines
1.8 KiB
Markdown

# RedditBot Session Exporter
This local Chrome extension exports `reddit.com` cookies and the current Reddit Chat Matrix credential into one JSON file for the self-hosted dashboard's **Import Reddit session** control. The file is equivalent to a login credential: do not share it, commit it, or send it to anyone.
## Install and use
1. In Chrome, open `chrome://extensions`, enable **Developer mode**, then choose **Load unpacked** and select this folder.
If it was already loaded, click its **Reload** button after updating these files so Chrome starts the new service worker.
2. Sign in to Reddit in the same Chrome profile.
3. Open [Reddit Chat](https://chat.reddit.com/) and wait for it to finish loading. Do not use `www.reddit.com/chat/`: its Matrix bridge can return HTTP 405. The extension badge changes to `OK` when it captures the Matrix credential. If no credential has been captured yet, clicking the extension opens the correct Chat host automatically.
4. Click the **RedditBot Session Exporter** toolbar icon and save `redditbot-session.json`.
5. In RedditBot Dashboard > Settings > Access, choose **Import Reddit session** and select the exported file.
6. Delete the downloaded JSON file once the dashboard confirms that the session is authenticated.
The extension observes only requests to Reddit's Matrix homeservers, verifies the captured token with Matrix `whoami`, reads Reddit cookies, and saves the combined export locally. It does not send the dump to any server; you upload it directly to your RedditBot dashboard.
Before downloading, the extension independently resolves the current identity through the open `www.reddit.com` tab and refuses the export unless its `t2` account ID matches Matrix `whoami`. If you switch accounts, reload Reddit Chat so the extension captures that account's current Matrix token.