Visualize, restore, and navigate ChatGPT conversation branches in Chrome and Firefox.
The project uses one shared content-script implementation with browser-specific manifests and generated builds for:
dist/chrome/dist/firefox/
Source of truth lives in:
logo.svgsrc/content.jssrc/content.csssrc/manifests/manifest.chrome.jsonsrc/manifests/manifest.firefox.json
Static assets live in:
src/assets/- Extension icon assets are generated from root
logo.svgintodist/*/icons/during build.
Build both browser targets with:
npm run buildor:
bash build.shThe build script:
- copies
src/content.jsandsrc/content.css - copies everything under
src/assets/ - writes browser-specific
manifest.json
Do not edit files under dist/ directly.
- Open
chrome://extensions - Enable
Developer mode - Click
Load unpacked - Select
dist/chrome/
- Open
about:debugging - Choose
This Firefox - Click
Load Temporary Add-on - Select
dist/firefox/manifest.json
ChatGIT/
|-- src/
| |-- content.js
| |-- content.css
| |-- assets/
| `-- manifests/
| |-- manifest.chrome.json
| `-- manifest.firefox.json
|-- scripts/
| `-- build.mjs
|-- dist/
| |-- chrome/
| `-- firefox/
|-- build.sh
|-- logo.svg
|-- package.json
`-- README.md
The extension no longer relies on fragile "find the nearest button and click it" behavior as the main strategy.
Current navigation flow:
- use
data-testidlikeconversation-turn-7as the stable position identifier - build a page-level reply switcher index that maps each turn to its version switcher
- read branch/version state from that index first
- use scored button selection as fallback instead of "first matching button wins"
- keep a final DOM-based fallback only as a safety net
This makes branch restoration more robust when:
data-message-idchanges across versions1/2and2/2text shifts visually- nearby turns have similar
Previous response/Next responsebuttons
The content UI also includes:
- automatic light/dark theme detection
- status toast attached to the extension root instead of floating over the page body
- pointer-event isolation so native ChatGPT controls remain hoverable and clickable
scripts/build.mjsis the single build entry for both browsers.- If you add more extension surfaces later, such as
background,popup, oroptions, extend the build script instead of hand-editingdist/. - If branch navigation regresses again, start by checking the reply switcher index and scored fallback in
src/content.js.