feat: show which Google account is used for Gemini Web search#5
Open
guilhermesilveira wants to merge 2 commits intonicobailon:mainfrom
Open
feat: show which Google account is used for Gemini Web search#5guilhermesilveira wants to merge 2 commits intonicobailon:mainfrom
guilhermesilveira wants to merge 2 commits intonicobailon:mainfrom
Conversation
Add getActiveGoogleEmail() that queries accounts.google.com/ListAccounts
to discover the primary Google account email from the Chrome cookies.
Changes:
- chrome-cookies.ts: add getActiveGoogleEmail(cookies) function
- gemini-web.ts: isGeminiWebAvailable() now returns { cookies, email }
- index.ts: add /google-account command to show active account
- Update all callers to use availability.cookies pattern
The /google-account command shows which email is being used for
Gemini Web searches, so users with multiple Google accounts know
exactly which one is active.
…tAccounts The ListAccounts endpoint (accounts.google.com) returns 400 because the cookies needed for that endpoint (LSID, __Host-1PLSID, __Host-GAPS, etc.) are not in the ALL_COOKIE_NAMES allowlist and are never sent. Instead, extract the email from the gemini.google.com/app HTML page, which already embeds the logged-in user's email and authenticates with the cookies we do have (__Secure-1PSID, SID, HSID, etc.). The ListAccounts approach is kept as a fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When multiple Google accounts are signed into Chrome, it's not obvious which one is being used for Gemini Web searches. This PR makes the active account visible.
What changed
chrome-cookies.tsAdded
getActiveGoogleEmail(cookies)— queriesaccounts.google.com/ListAccounts(the same endpoint Chrome uses internally) to discover the primary account email. No extra dependencies.gemini-web.tsisGeminiWebAvailable()now returns{ cookies, email }instead of justCookieMap. The email is fetched once alongside cookie validation.index.tsAdded
/google-accountcommand that shows which Google account is active:Gemini Web using: user@gmail.comAll callers updated
gemini-search.ts,gemini-url-context.ts,video-extract.ts,youtube-extract.ts— all updated to useavailability.cookiespattern. No behavior change.