X Stream Chat is a browser extension that allows you to relay chat messages from X (formerly Twitter) broadcasts to a local WebSocket server. This enables you to display these messages in a customizable chat overlay for streaming purposes.
- Capture chat messages from X broadcasts in real-time
- Relay messages to a local WebSocket server
- Customizable chat display options
- Status page to monitor connections and message flow
- Node.js (v14 or later recommended)
- pnpm (recommended) or npm
- A Chromium-based browser (e.g., Google Chrome, Microsoft Edge)
-
Clone this repository:
git clone https://github.com/your-username/x-stream-chat.git cd x-stream-chat
-
Install dependencies using pnpm (recommended) or npm:
pnpm install # or npm install
-
Build the extension:
pnpm run build # or npm run build
- Open your browser and navigate to
chrome://extensions
- Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the
distribution
folder in the project directory
Use web-ext
for development and testing:
-
Open the X Stream Chat extension popup by clicking on its icon in your browser toolbar.
-
Configure the settings:
- Enter the host and port for your WebSocket server (default: localhost:8585)
- Choose your preferred font and font size
- Select which elements to display (profile picture, username, handle, timestamp)
-
Click "Save" to apply your settings.
-
Toggle the switch to enable the connection to the WebSocket server.
-
Navigate to an X broadcast page. The extension will automatically start capturing chat messages and sending them to your server.
-
Open
http://localhost:8585
in a browser or add it as a browser source in your streaming software to display the chat overlay.
-
To watch for changes and rebuild the extension automatically:
npm run watch
-
To run the extension in development mode with live reloading:
npm run dev
-
If you're not seeing any messages, make sure:
- The extension is enabled and connected (check the popup)
- You're on an X broadcast page
- The WebSocket server is running
- Check the browser console for any error messages
-
To view the extension's background script logs:
- Go to
chrome://extensions
- Find X Stream Chat and click on "background page" under "Inspect views"
- Go to
Contributions are welcome! Please feel free to submit a Pull Request.