AxiomCode
AI 소프트웨어 엔지니어링을 위한 검증 가능한 인텔리전스, 형식화된 코드 그래프 기반
A minimal browser extension that shows a live token count and Gemini's own usage limits on gemini.google.com, exports any conversation to Markdown or plain text, and puts your limits one click away from any tab.
README 전체를 불러오는 중입니다.
README 전문 보기 ↗https://github.com/user-attachments/assets/e712dc61-70e2-48b0-b3cd-e2ac814c071e
/u/0, /u/1, …), each with its own figuresThe extension requests a single permission, storage. It runs on gemini.google.com and nowhere else, so that is the only site the browser lists it as able to access. The popup asks for its own access to gemini.google.com only if you press refresh there.
| Dark | Light |
|---|---|
The toolbar popup: your limits from any tab, a switch for each part, and a prefilled bug report.
| Usage limits | Settings | Send feedback |
|---|---|---|
Chromium (Chrome, Edge, Brave, Opera, Vivaldi, Arc, and any other Chromium-based browser; version 111 or later)
chrome://extensions on Chrome, brave://extensions on Brave, edge://extensions on Edge, or the equivalent for your browser) and turn on Developer mode.Firefox is not supported.
The extension has two halves that run in two different JavaScript worlds, because the token Gemini's own requests carry is only visible to the page itself, not to a normal content script.
1. The page-world bridge (src/injected/bridge.js)
This script runs in the page's own execution context (the "main world"), not the isolated content script sandbox. The manifest declares it with "world": "MAIN" and "run_at": "document_start", so it is in place before Gemini's first script and keeps the browser's own fetch, not a wrapper Gemini adds later.
Gemini's web app talks to its server through one endpoint, /_/BardChatUi/data/batchexecute, with a named RPC per request and the page's CSRF token (WIZ_global_data.SNlM0e). The bridge makes two of those calls, the same ones Gemini's own pages make, and nothing else:
jSf9Qc: your usage limits, exactly what Gemini's usage page asks for.hNvQHb: a conversation's turns, newest first, 50 to a page, following the page token. A long chat stops at 40 pages or 45 seconds and says it is partial, rather than running into the content script's timeout and showing nothing.The token rotates during a long session, so it is read fresh on every call. Signed into more than one Google account, the bridge uses the account of the page you are on (/u/1/…). Gemini's answers are length-prefixed chunks whose lengths cannot be trusted to slice by, so the bridge finds each JSON array by bracket matching instead.
Because the bridge runs in the page's own world, it cannot call extension APIs, and the content script cannot call anything the bridge defines. The only channel between them is window.postMessage, tagged gc: 'GeminiCounter' and matched by request id. The bridge answers its own two requests and no others, and checks a conversation id is the hex id Gemini itself uses before it goes into a request.
2. The content script (src/content/*.js)
Runs in the isolated content script world, declared in manifest.json against https://gemini.google.com/*. It is responsible for everything you see:
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗