fix: open the dedicated Reddit Chat host

This commit is contained in:
jjbrunton committed 2026-08-08 20:20:03 +01:00
1 parent 48492d5238
commit 8df2d648dd
5 files changed
+16 -3

No files matched your search

@@ -1,6 +1,7 @@
import {
assertMatchingSessionIdentity,
createSessionExportDownload,
REDDIT_CHAT_URL,
} from './session-export.js';
const MATRIX_URLS = [
@@ -64,7 +65,13 @@ chrome.action.onClicked.addListener(async () => {
const cookies = await chrome.cookies.getAll({ domain: 'reddit.com' });
const { matrixCapture } = await chrome.storage.local.get('matrixCapture');
if (!matrixCapture) {
throw new Error('Open Reddit Chat, wait for it to load, then click the extension again.');
await chrome.tabs.create({ url: REDDIT_CHAT_URL });
await chrome.action.setBadgeText({ text: '...' });
await chrome.action.setBadgeBackgroundColor({ color: '#6c757d' });
await chrome.action.setTitle({
title: 'Reddit Chat opened. Wait for the badge to show OK, then click again.',
});
return;
}
const whoami = await fetch(`${matrixCapture.homeserver}/_matrix/client/v3/account/whoami`, {