{"id":21012319,"url":"https://github.com/codebanesr/cobrowsing-ws","last_synced_at":"2026-04-21T20:02:35.414Z","repository":{"id":54899762,"uuid":"268125465","full_name":"codebanesr/cobrowsing-ws","owner":"codebanesr","description":"Websocket implementation for cobrowsing","archived":false,"fork":false,"pushed_at":"2022-12-07T21:44:52.000Z","size":998,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"demo.shailesh","last_synced_at":"2025-01-20T11:29:22.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebanesr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-30T17:12:58.000Z","updated_at":"2023-06-07T06:46:57.000Z","dependencies_parsed_at":"2023-01-24T12:16:24.185Z","dependency_job_id":null,"html_url":"https://github.com/codebanesr/cobrowsing-ws","commit_stats":null,"previous_names":["codebanesr/cobrowsing-ws"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fcobrowsing-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fcobrowsing-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fcobrowsing-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fcobrowsing-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebanesr","download_url":"https://codeload.github.com/codebanesr/cobrowsing-ws/tar.gz/refs/heads/demo.shailesh","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243437965,"owners_count":20290864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:36:16.872Z","updated_at":"2025-12-28T00:18:58.334Z","avatar_url":"https://github.com/codebanesr.png","language":"JavaScript","readme":"# Co-browsing WebSocket App\n\nAn open-source collaborative co-browsing application that allows multiple users to browse web pages together in real-time. The system consists of a backend WebSocket server built with Bun and a Chrome extension for capturing and synchronizing browser events.\n\n## Features\n\n- **Real-time Synchronization**: All user interactions (clicks, scrolls, form inputs) are synchronized across connected clients\n- **Control Handover**: Users can request and release control of the browsing session\n- **Room-based Sessions**: Create or join rooms using simple room IDs\n- **Chrome Extension**: Easy-to-use browser extension with popup interface\n- **WebSocket Communication**: Fast, low-latency communication using WebSockets\n\n## Architecture\n\n- **Backend Server** (`backend/server.ts`): Bun-based WebSocket server handling room management and event synchronization\n- **Chrome Extension** (`extension/`): Browser extension with content scripts, background scripts, and popup UI\n- **Event Synchronization**: Real-time capture and replay of DOM events across clients\n\n## Setup Instructions\n\n### Prerequisites\n\n- [Bun](https://bun.sh/) runtime\n- Node.js (for extension build tools)\n- Google Chrome browser\n\n### Backend Setup\n\n1. Install dependencies:\n   ```bash\n   bun install\n   ```\n\n2. Start the server:\n   ```bash\n   bun run dev\n   ```\n   \n   The server will start on `localhost:8080`\n\n### Chrome Extension Setup\n\n1. Navigate to the extension directory and install dependencies:\n   ```bash\n   cd extension\n   npm install\n   ```\n\n2. Build the extension:\n   ```bash\n   npm run build\n   ```\n\n3. Load the extension in Chrome:\n   - Open Chrome and go to `chrome://extensions/`\n   - Enable \"Developer mode\" in the top right\n   - Click \"Load unpacked\" and select the `extension/dist` folder\n\n## Usage\n\n1. **Start the backend server** using `bun run dev`\n2. **Open the Chrome extension** by clicking the extension icon in your browser\n3. **Create or join a room**:\n   - Click \"Create Room\" to start a new session and get a room ID\n   - Or enter a room ID and click \"Join Room\" to join an existing session\n4. **Control the session**:\n   - The room creator has control by default\n   - Other users can click \"Request Control\" to take control\n   - The controller can click \"Release Control\" to give up control\n5. **Browse together**: All interactions from the controller are synchronized to other participants\n\n## Project Structure\n\n```\ncobrowsing-ws/\n├── backend/\n│   └── server.ts           # WebSocket server\n├── extension/\n│   ├── src/\n│   │   ├── background.js   # Extension background script\n│   │   ├── content.js      # Content script for DOM interaction\n│   │   ├── popup.js        # Popup UI logic\n│   │   └── injected.js     # Page context event capture\n│   ├── public/\n│   │   ├── manifest.json   # Extension manifest\n│   │   └── popup.html      # Popup UI\n│   └── dist/               # Built extension files\n├── package.json\n└── README.md\n```\n\n## Development\n\n### Backend Development\n- The server auto-reloads with `bun run dev`\n- WebSocket connections are handled on port 8080\n- Room management and event broadcasting logic in `backend/server.ts`\n\n### Extension Development\n- Use `npm run dev` in the `extension` directory for development builds\n- Reload the extension in Chrome after making changes\n- Check browser console and extension background page for debugging\n\n## Technical Details\n\n### Event Synchronization\nThe system captures and synchronizes:\n- **Scroll events**: Window scroll position\n- **Click events**: Element clicks with CSS selectors\n- **Input events**: Form field changes\n- **Form submissions**: Complete form data\n- **Navigation**: URL changes\n\n### Security Considerations\n- Only captures events from the controlling user\n- Uses CSS selectors for element targeting (no direct DOM references)\n- WebSocket connections are local by default (localhost:8080)\n\n## Contributing\n\nThis is an open-source project. Contributions are welcome!\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n## License\n\nOpen source - feel free to use and modify as needed.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebanesr%2Fcobrowsing-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebanesr%2Fcobrowsing-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebanesr%2Fcobrowsing-ws/lists"}