DOOM injected natively into the Codex IDE runtime.
A proof-of-concept project demonstrating how to dynamically inject and execute legacy software (DOOM via WebAssembly) natively inside an arbitrary Electron/React application (Codex) using the Chrome DevTools Protocol (CDP) and WebSockets.
The magic is entirely fileless and minimally invasive. The project consists of just two files: a bash/python injector and a frontend HTML shell.
- CDP Hijacking:
doom-inject.shautomatically safely restarts the background Codex process with the--remote-debugging-portenabled. - WebSocket Injection: A native Python script leverages the debugging WebSocket to continuously inject a native CSS-matched interactive tab into Codex's React-based DOM using headless
Runtime.evaluateevaluation. - Cloud Native Boot: Once the injected tab is active, the environment is redirected to a lightweight local HTTP server delivering the DOS WebAssembly emulator.
- Zero-weight Assets: The entire
DOOM.WADand emulator core are streamed seamlessly from the cloud (viados.zoneCDN) to preserve an incredibly lightweight footprint (< 30KB total). No actual game binaries are stored locally.
- Painless UI Injection: Bypasses React's DOM-management to mount a highly cohesive element directly within the Codex sidebar.
- Deep Clean Emulator: All JS-DOS visual wrappers, toolbars, virtual keyboards, and settings buttons are stripped away via extreme CSS DOM-piercing to leave a 100% immersive, borderless gaming canvas.
- Auto-Cleanup Daemon: Integrates background process handling via
trap. Closing the terminal (Ctrl+C) gracefully spins down the HTTP server, drops the CDP socket, and cleanly shuts down the injected instance. - Themed UI: Features an OS-aware interactive boot screen supporting both
LightandDarkpreference modes.
No Node.js, no npm install, and no huge dependencies required. If you have Python 3 and macOS, you're ready to go.
git clone https://github.com/cloverfield11/codex-inject-doom.git
cd doom-codex
# Launch the automated injection sequence
./doom-inject.shWatch the terminal report back the successful WebSocket handshake and launch sequence. Once Codex opens:
- Click the
Codex.inject(DOOM);tab embedded in the sidebar. - Play DOOM.
- Press
✕ Return to Codexto kill the canvas cleanly and return to your code.
- Injection logic and UI design by @cloverfield11
- DOOM running in browser using the incredible js-dos v8.
- DOOM assets hosted by indexers at dos.zone.