Files
yetone 38594b5aee gemini-web 0.1.0: the Gemini web app, one streamed call to its own endpoint per request
@jtbbtnt54249 on X (11-18) asked for a Gemini web plugin: the community
@dorokuma/magpie-gemini-web is "太慢了根本用不了". The MCP in their
screenshot is a Gemini web "custom app" remote connector: Google's servers
call a public MCP URL, so it can't serve a local agent and is not a route.

Why the existing one is slow: it goes through a separate local Go backend
that fetches the XSRF token before every request, uploads prompts over
128KB as a file, sleeps 2s between retries, and holds replies behind a
tool-fence gate and a slot limiter.

This package calls gemini.google.com the way the app's page does:
- the page's tokens (SNlM0e, cfb2h, FdrFJe) are read from /app once and
  kept 15 minutes;
- each request is one POST to StreamGenerate, the whole request inline in
  a temporary chat (slot 45, nothing kept in history), read as it
  streams and given back as SSE or a whole completion;
- tools are asked for as <tool_call> text (prompt.mjs and openai.mjs from
  doubao-work) and given back as tool_calls;
- signed in: a Chrome profile of the plugin's own opens at Google's
  sign-in, the user signs in themselves, the google.com cookies are read
  with Storage.getCookies on the browser target (nothing attached to the
  page) and the window closes. Set-Cookie renewals are saved back with
  client.auth.set; RotateCookies every ten minutes; signed out, rotate,
  then reopen the profile headless, then ask for a sign-in;
- a visitor (no account) gets Google's visitor model;
- models from the account's own picker (otAQ7b), fallback marked;
- prompts over 600K characters get 413 before they are sent (measured:
  315K fine, 900K ignored the request, 1.8M refused with error 3); error 3
  is named as a refusal with its likely causes.

Run:
- HOME=$(mktemp -d) bun test packages/gemini-web on mote: 28 pass. The
  fixtures are real StreamGenerate replies (a signed-in "pong" served as
  4 Hydrogen, a visitor's rivers text with its real chunks) and a real
  otAQ7b list, with the location Google guessed scrubbed.
- Broken by hand: not sending `at` turns two tests red.
- Full suite on mote, HOME=$(mktemp -d) bun test at ea805ecc plus this change (before the root README line): 9091 pass, 20 skip, 0 fail.
- bun scripts/check.mjs: registry.json and gemini-web ok.
- Real, through the plugin's fetch from Bun on mote, as a visitor: three
  "pong" requests, first text at 14.0s (reads the page), 7.9s, 6.9s; a
  tool request came back as Echo {"text":"391"} with finish tool_calls.
  Signed in, in the app's own page: first text about 3.5s.

Not tried: a real Google sign-in through the plugin's window (Google may
refuse a browser with a DevTools port open), whether DBSC stops
RotateCookies, thinking output, paid models (4 Carbon, 4 Neon). Said in
the README.

First publish of a new package: publish.yml can't publish it (no trusted
publisher yet), so magpie installs it from the dist branch until the
owner publishes it once and adds the trust.
2026-11-19 14:14:50 +08:00

9 lines
8.8 KiB
Plaintext

)]}'
8916
[["wrb.fr","otAQ7b","[1,[false,null,false],false,null,null,null,false,null,null,null,null,null,false,false,null,[[\"cf41b0e0dd7d53e5\",\"Auto\",\"Adapts to your needs\",[2,140,1,3,4,5,6,135,7,8,62,9,10,11,231,66,98,99,100,64,12,97,111,72,73,74,0,18,20,22,25,54,127,129,141,61,86,95,87,90,91,50,51,218,139,80,82,229,117,13,26,60,32,184,68,70,93,112,113,96,116,124,204,133,155,230,166,136,142,143,144,226,154,164,158,159,161,165,170,177,214,179,181,187,189,190,191,195,200,201,291,206,210,225,234,235,236,237,238,239,241,242,248,250,251,253,254,259,260,262,264,268,275,283,300],1,null,[\"1bc6b5d98741cd3d\",\"1a43ad63cc8a7f9a\",\"7daceb7ef88130f5\",\"418ab5ea040b5c43\",\"a8236212c11d3a06\",\"f299729663a2343f\",\"948b866104ccf484\",\"cf84a01064f3134f\",\"35609594dbe934d8\",\"5bf011840784117a\",\"e051ce1aa80aa576\",\"8c46e95b1a07cecc\",\"1d44b34bcaa1c04d\",\"7ca48d02d802f20a\",\"cd472a54d2abba7e\",\"f8f8f5ea629f5d37\",\"9c17b1863f581b8a\",\"1acf3172319789ce\",\"71c2d248d3b102ff\",\"9ec249fc9ad08861\",\"fbb127bbb056c959\",\"56fdd199312815e2\"],false,\"\",1,\"Auto\",\"Auto\",\"Adapts to your needs\",null,null,false,\"\",6,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/bolt/default/24px.svg\",true],\"Auto\"]],[9,38],[2,140,1,3,4,5,6,135,7,8,62,9,10,11,231,66,98,99,100,64,12,97,111,72,73,74,15,0,18,20,22,23,25,54,127,129,141,61,86,95,87,90,91,50,51,218,139,80,82,229,117,13,26,60,32,184,68,70,93,112,113,96,116,124,204,133,155,230,166,136,142,143,144,226,154,164,158,159,161,165,170,177,214,179,181,187,189,190,191,195,200,201,291,206,210,225,234,235,236,237,238,239,241,242,248,250,251,253,254,259,260,262,264,268,275,283,300],\"\",[[1,124,2,\"Sources\",\"Sources\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/add/default/24px.svg\",\"Choose one or more sources\",[[1,124,true,\"Search\",null,[\"https://www.gstatic.com/images/branding/productlogos/googleg/v6/24px.svg\",false],null,278132],[3,124,null,\"Gmail\",null,[\"https://www.gstatic.com/images/branding/productlogos/gmail_2020q4/v11/192px.svg\",false],null,278130],[4,124,null,\"Drive\",null,[\"https://www.gstatic.com/images/branding/productlogos/drive_2020q4/v10/192px.svg\",false],null,278131],[12,124,null,\"Chat\",null,[\"https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v2/192px.svg\",false],null,278557]],1,278129,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/add/default/24px.svg\",true]],[1,133,3,\"Files\",\"Files\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/upload/default/24px.svg\",null,null,4,278128,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/upload/default/24px.svg\",true]],[14,248,1,\"Aspect ratio\",\"Aspect ratio\",null,\"Aspect ratio\",[[61,248,null,\"1:1\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_square/default/24px.svg\",true],null,349764],[59,248,null,\"9:16\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_9_16/default/24px.svg\",true],null,349762],[60,248,null,\"3:4\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_portrait/default/24px.svg\",true],null,349765],[62,248,null,\"4:3\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_landscape/default/24px.svg\",true],null,349761],[63,248,null,\"16:9\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_16_9/default/24px.svg\",true],null,349763]],19,349760,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/aspect_ratio/default/24px.svg\",true],null,null,3,1],[11,185,1,\"Aspect ratio\",\"Aspect ratio\",null,\"Aspect ratio\",[[16,185,true,\"Landscape (16:9)\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_16_9/default/24px.svg\",true],null,316863,\"Landscape\"],[17,185,null,\"Portrait (9:16)\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/crop_9_16/default/24px.svg\",true],null,316864,\"Portrait\"]],12,316870,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/aspect_ratio/default/24px.svg\",true],null,null,3,1],[21,230,1,\"Length\",\"Length\",null,\"Length\",[[42,230,null,\"Short\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/schedule/default/24px.svg\",true],null,null,\"Short\"],[43,230,null,\"Standard\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/schedule/default/24px.svg\",true],null,null,\"Standard\"]],16,337419,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/schedule/default/24px.svg\",true],null,null,3,1],[21,230,1,\"Vocals\",\"Vocals\",null,\"Vocals\",[[69,230,null,\"Custom\",\"Based on your prompt\",[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/chat_spark_2/default/24px.svg\",true],null,null,\"Custom\"],[27,230,null,\"Vocals on\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/record_voice_over/default/24px.svg\",true],null,null,\"Vocals on\"],[26,230,null,\"Instrumental\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/voice_over_off/default/24px.svg\",true],null,null,\"Instrumental\"]],17,339102,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/record_voice_over/default/24px.svg\",true],null,null,3,1],[21,230,1,\"Genre\",\"Genre\",null,\"Genre\",[[41,230,null,\"Custom\",\"Based on your prompt\",[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/chat_spark_2/default/24px.svg\",true],null,null,\"Custom\"],[44,230,null,\"Pop\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Pop\"],[45,230,null,\"Hip-hop \\u0026 rap\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Hip-hop \\u0026 rap\"],[46,230,null,\"Rock\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Rock\"],[40,230,null,\"K-pop\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"K-pop\"],[55,230,null,\"Latin\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Latin\"],[47,230,null,\"Electronic\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Electronic\"],[48,230,null,\"R\\u0026B\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"R\\u0026B\"],[49,230,null,\"Country\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Country\"],[56,230,null,\"Afrobeats\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Afrobeats\"],[57,230,null,\"Reggae\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Reggae\"],[50,230,null,\"Jazz \\u0026 blues\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Jazz \\u0026 blues\"],[52,230,null,\"Classical\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Classical\"],[54,230,null,\"Folk\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Folk\"],[51,230,null,\"Lo-fi\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Lo-fi\"],[53,230,null,\"Acoustic\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Acoustic\"],[36,230,null,\"Cinematic\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Cinematic\"],[68,230,null,\"Ambient\",null,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,\"Ambient\"]],18,339104,[\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/music_note/default/24px.svg\",true],null,null,2,1]],\"\",null,[true],null,[\"launch_free_policy\",[[[\"\",6,false,null,\"Auto\",\"Adapts to your needs\",null,false,null,null,false,null,\"Auto\",[2,140,1,3,4,5,6,135,7,8,62,9,10,11,231,66,98,99,100,64,12,97,111,72,73,74,15,0,18,20,22,23,25,54,127,129,141,61,86,95,87,90,91,50,51,218,139,80,82,229,117,13,26,60,32,184,68,70,93,112,113,96,116,124,204,133,155,230,166,136,142,143,144,226,154,164,158,159,161,165,170,177,214,179,181,187,189,190,191,195,200,201,291,206,210,225,234,235,236,237,238,239,241,242,248,250,251,253,254,259,260,262,264,268,275,283,300],null,1],null,1,[1]]]]]",null,null,null,"generic"]]
57
[["di",248],["af.httprm",247,"-8294519921314018455",1]]
26
[["e",4,null,null,9013]]