[{"data":1,"prerenderedAt":623},["ShallowReactive",2],{"post-en-restore-chrome-ask-gemini-by-modifying-local-state":3,"surround-en-blog\u002Fen\u002Fblog\u002Frestore-chrome-ask-gemini-by-modifying-local-state.md":616},{"id":4,"title":5,"body":6,"canonical":173,"category":600,"date":601,"description":602,"extension":603,"image":604,"meta":605,"navigation":443,"path":606,"seo":607,"slug":608,"status":609,"stem":610,"tags":611,"translationSlug":608,"__hash__":615},"blog\u002Fen\u002Fblog\u002Frestore-chrome-ask-gemini-by-modifying-local-state.md","Restore Missing \"Ask Gemini\" in Chrome: Local State Fix Guide and Underlying Mechanics",{"type":7,"value":8,"toc":589},"minimark",[9,18,38,41,46,53,60,93,99,103,124,130,145,149,154,157,167,222,232,243,247,252,271,274,318,322,328,382,415,418,519,523,526,567,570,574,585],[10,11,12,13,17],"p",{},"I frequently use the \"Ask Gemini\" AI assistant in Chrome's address bar to summarize web pages. However, after moving environments or reinstalling Chrome, this entry point frequently vanishes without warning. Toggling flags under ",[14,15,16],"code",{},"chrome:\u002F\u002Fflags"," or changing the browser UI language to English often fails to bring the icon back.",[10,19,20,21,29,30,33,34,37],{},"The proven solution is straightforward: ",[22,23,24,25,28],"strong",{},"Chrome gates feature access based on the country code persisted in your user profile's ",[14,26,27],{},"Local State"," file",". Changing the persisted regional code from ",[14,31,32],{},"cn"," to ",[14,35,36],{},"us"," restores access reliably.",[10,39,40],{},"Yet in practice, 90% of developers find their manual edits either \"fail to take effect\" or get instantly reverted by Chrome upon launch. This guide covers the memory flush mechanics behind this behavior and a reliable step-by-step procedure.",[42,43,45],"h2",{"id":44},"underlying-mechanics-why-switching-ui-to-english-fails","Underlying Mechanics: Why Switching UI to English Fails",[10,47,48,49,52],{},"Internally, Google refers to this integrated side-panel assistant by the project codename ",[14,50,51],{},"glic"," (Gemini Live in Chrome).",[10,54,55,56,59],{},"A common assumption is that changing UI language to ",[14,57,58],{},"English (United States)"," or routing traffic through a global proxy will unlock the feature. However, Chrome's regional gating does not rely solely on real-time IP at startup, nor does it reset with UI language:",[61,62,63,70],"ol",{},[64,65,66,69],"li",{},[22,67,68],{},"Google Variations Pinning",": Chrome runs an experiment and rollout service (Google Variations). When syncing over the network, it computes a regional country assignment and locks it into local storage.",[64,71,72,75,76,79,80,83,84,86,87,89,90,92],{},[22,73,74],{},"Local State Persistence",": This country code is saved under ",[14,77,78],{},"variations_country"," and ",[14,81,82],{},"variations_permanent_consistency_country"," in ",[14,85,27],{},". As long as these keys remain set to ",[14,88,32],{},", Chrome treats the browser as located in a non-eligible region and hides ",[14,91,51],{}," completely.",[94,95,96],"blockquote",{},[10,97,98],{},"Note: This article details Chrome profile configurations and Google Variations gating. Make sure you understand the memory flush timing before modifying configuration files.",[42,100,102],{"id":101},"the-common-pitfall-why-edits-get-instantly-overwritten","The Common Pitfall: Why Edits Get Instantly Overwritten",[10,104,105,106,108,109,111,112,114,115,117,118,120,121,123],{},"Many tutorials instruct users to open ",[14,107,27],{},", find ",[14,110,32],{},", replace it with ",[14,113,36],{},", and save. But upon restarting Chrome, the icon remains absent—and checking ",[14,116,27],{}," shows ",[14,119,36],{}," was rewritten back to ",[14,122,32],{},".",[10,125,126,129],{},[22,127,128],{},"The root cause is Chrome's in-memory state dump",":",[131,132,133,139],"ul",{},[64,134,135,136,123],{},"If you edit the file while Chrome (or any background Chrome Helper process) is still running, closing the browser triggers a memory dump that writes active state back to disk, ",[22,137,138],{},"instantly overwriting your changes",[64,140,141,142,123],{},"Consequently, ",[22,143,144],{},"fully terminating all Chrome processes must happen before opening and editing the file",[42,146,148],{"id":147},"step-by-step-guide","Step-by-Step Guide",[150,151,153],"h3",{"id":152},"step-1-completely-terminate-chrome-processes","Step 1: Completely Terminate Chrome Processes",[10,155,156],{},"Do not merely close the browser window or minimize it; ensure all background helper processes have exited.",[10,158,159,162,163,166],{},[22,160,161],{},"macOS Users",":\nRight-click Chrome in the Dock and select \"Quit\" (",[14,164,165],{},"Cmd + Q","), or terminate it cleanly via terminal:",[168,169,174],"pre",{"className":170,"code":171,"language":172,"meta":173,"style":173},"language-sh shiki shiki-themes github-light github-dark","osascript -e 'quit app \"Google Chrome\"'\n# 检查是否还有残留进程\npgrep -f \"Google Chrome\" || echo \"Chrome 已彻底退出\"\n","sh","",[14,175,176,193,200],{"__ignoreMap":173},[177,178,181,185,189],"span",{"class":179,"line":180},"line",1,[177,182,184],{"class":183},"sScJk","osascript",[177,186,188],{"class":187},"sj4cs"," -e",[177,190,192],{"class":191},"sZZnC"," 'quit app \"Google Chrome\"'\n",[177,194,196],{"class":179,"line":195},2,[177,197,199],{"class":198},"sJ8bj","# 检查是否还有残留进程\n",[177,201,203,206,209,212,216,219],{"class":179,"line":202},3,[177,204,205],{"class":183},"pgrep",[177,207,208],{"class":187}," -f",[177,210,211],{"class":191}," \"Google Chrome\"",[177,213,215],{"class":214},"szBVR"," ||",[177,217,218],{"class":187}," echo",[177,220,221],{"class":191}," \"Chrome 已彻底退出\"\n",[10,223,224,227,228,231],{},[22,225,226],{},"Windows Users",":\nOpen Task Manager (",[14,229,230],{},"Ctrl + Shift + Esc",") or force-stop leftover processes in PowerShell:",[168,233,237],{"className":234,"code":235,"language":236,"meta":173,"style":173},"language-powershell shiki shiki-themes github-light github-dark","Stop-Process -Name chrome -Force -ErrorAction SilentlyContinue\n","powershell",[14,238,239],{"__ignoreMap":173},[177,240,241],{"class":179,"line":180},[177,242,235],{},[150,244,246],{"id":245},"step-2-locate-and-back-up-the-config-file","Step 2: Locate and Back Up the Config File",[10,248,249,251],{},[14,250,27],{}," is a JSON-formatted global configuration file. Always create a backup before modifying it.",[131,253,254,263],{},[64,255,256,259,260],{},[22,257,258],{},"macOS Path",":\n",[14,261,262],{},"~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FLocal State",[64,264,265,259,268],{},[22,266,267],{},"Windows Path",[14,269,270],{},"%LOCALAPPDATA%\\Google\\Chrome\\User Data\\Local State",[10,272,273],{},"Create a backup in macOS terminal:",[168,275,277],{"className":170,"code":276,"language":172,"meta":173,"style":173},"LOCAL_STATE=\"$HOME\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FLocal State\"\ncp \"$LOCAL_STATE\" \"${LOCAL_STATE}.bak\"\n",[14,278,279,297],{"__ignoreMap":173},[177,280,281,285,288,291,294],{"class":179,"line":180},[177,282,284],{"class":283},"sVt8B","LOCAL_STATE",[177,286,287],{"class":214},"=",[177,289,290],{"class":191},"\"",[177,292,293],{"class":283},"$HOME",[177,295,296],{"class":191},"\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FLocal State\"\n",[177,298,299,302,305,308,310,313,315],{"class":179,"line":195},[177,300,301],{"class":183},"cp",[177,303,304],{"class":191}," \"",[177,306,307],{"class":283},"$LOCAL_STATE",[177,309,290],{"class":191},[177,311,312],{"class":191}," \"${",[177,314,284],{"class":283},[177,316,317],{"class":191},"}.bak\"\n",[150,319,321],{"id":320},"step-3-update-regional-keys","Step 3: Update Regional Keys",[10,323,324,325,327],{},"Open ",[14,326,27],{}," in VS Code or any text editor, then locate and update these three keys:",[168,329,333],{"className":330,"code":331,"language":332,"meta":173,"style":173},"language-json shiki shiki-themes github-light github-dark","{\n  \"variations_country\": \"us\",\n  \"variations_permanent_consistency_country\": \"us\",\n  \"is_glic_eligible\": true\n}\n","json",[14,334,335,340,354,365,376],{"__ignoreMap":173},[177,336,337],{"class":179,"line":180},[177,338,339],{"class":283},"{\n",[177,341,342,345,348,351],{"class":179,"line":195},[177,343,344],{"class":187},"  \"variations_country\"",[177,346,347],{"class":283},": ",[177,349,350],{"class":191},"\"us\"",[177,352,353],{"class":283},",\n",[177,355,356,359,361,363],{"class":179,"line":202},[177,357,358],{"class":187},"  \"variations_permanent_consistency_country\"",[177,360,347],{"class":283},[177,362,350],{"class":191},[177,364,353],{"class":283},[177,366,368,371,373],{"class":179,"line":367},4,[177,369,370],{"class":187},"  \"is_glic_eligible\"",[177,372,347],{"class":283},[177,374,375],{"class":187},"true\n",[177,377,379],{"class":179,"line":378},5,[177,380,381],{"class":283},"}\n",[131,383,384,397,404],{},[64,385,386,387,390,391,394,395,123],{},"Change ",[14,388,389],{},"\"variations_country\""," (previously ",[14,392,393],{},"\"cn\""," or another regional code) to ",[14,396,350],{},[64,398,386,399,33,402,123],{},[14,400,401],{},"\"variations_permanent_consistency_country\"",[14,403,350],{},[64,405,406,407,410,411,414],{},"If ",[14,408,409],{},"\"is_glic_eligible\""," exists in your build, set it to ",[14,412,413],{},"true"," (if absent, do not add it manually; leave as is).",[10,416,417],{},"If you prefer command-line automation, run this safe Python replacement after Chrome is fully closed:",[168,419,421],{"className":170,"code":420,"language":172,"meta":173,"style":173},"python3 -c '\nimport json, os\n\npath = os.path.expanduser(\"~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FLocal State\")\nwith open(path, \"r\", encoding=\"utf-8\") as f:\n    data = json.load(f)\n\ndata[\"variations_country\"] = \"us\"\ndata[\"variations_permanent_consistency_country\"] = \"us\"\nif \"is_glic_eligible\" in data:\n    data[\"is_glic_eligible\"] = True\n\nwith open(path, \"w\", encoding=\"utf-8\") as f:\n    json.dump(data, f, ensure_ascii=False)\nprint(\"Local State 更新成功\")\n'\n",[14,422,423,434,439,445,450,455,461,466,472,478,484,490,495,501,507,513],{"__ignoreMap":173},[177,424,425,428,431],{"class":179,"line":180},[177,426,427],{"class":183},"python3",[177,429,430],{"class":187}," -c",[177,432,433],{"class":191}," '\n",[177,435,436],{"class":179,"line":195},[177,437,438],{"class":191},"import json, os\n",[177,440,441],{"class":179,"line":202},[177,442,444],{"emptyLinePlaceholder":443},true,"\n",[177,446,447],{"class":179,"line":367},[177,448,449],{"class":191},"path = os.path.expanduser(\"~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FLocal State\")\n",[177,451,452],{"class":179,"line":378},[177,453,454],{"class":191},"with open(path, \"r\", encoding=\"utf-8\") as f:\n",[177,456,458],{"class":179,"line":457},6,[177,459,460],{"class":191},"    data = json.load(f)\n",[177,462,464],{"class":179,"line":463},7,[177,465,444],{"emptyLinePlaceholder":443},[177,467,469],{"class":179,"line":468},8,[177,470,471],{"class":191},"data[\"variations_country\"] = \"us\"\n",[177,473,475],{"class":179,"line":474},9,[177,476,477],{"class":191},"data[\"variations_permanent_consistency_country\"] = \"us\"\n",[177,479,481],{"class":179,"line":480},10,[177,482,483],{"class":191},"if \"is_glic_eligible\" in data:\n",[177,485,487],{"class":179,"line":486},11,[177,488,489],{"class":191},"    data[\"is_glic_eligible\"] = True\n",[177,491,493],{"class":179,"line":492},12,[177,494,444],{"emptyLinePlaceholder":443},[177,496,498],{"class":179,"line":497},13,[177,499,500],{"class":191},"with open(path, \"w\", encoding=\"utf-8\") as f:\n",[177,502,504],{"class":179,"line":503},14,[177,505,506],{"class":191},"    json.dump(data, f, ensure_ascii=False)\n",[177,508,510],{"class":179,"line":509},15,[177,511,512],{"class":191},"print(\"Local State 更新成功\")\n",[177,514,516],{"class":179,"line":515},16,[177,517,518],{"class":191},"'\n",[150,520,522],{"id":521},"step-4-verify-environment-and-launch","Step 4: Verify Environment and Launch",[10,524,525],{},"After saving changes and reopening Chrome, ensure these three prerequisites are met to prevent Google Variations from reverting:",[61,527,528,549,561],{},[64,529,530,533,534,537,538,540,541,544,545,548],{},[22,531,532],{},"Flags Experiment",": Navigate to ",[14,535,536],{},"chrome:\u002F\u002Fflags\u002F",", search for ",[14,539,51],{}," or ",[14,542,543],{},"gemini",", set relevant entries to ",[14,546,547],{},"Enabled",", and relaunch.",[64,550,551,554,555,558,559,123],{},[22,552,553],{},"UI Language",": Go to ",[14,556,557],{},"chrome:\u002F\u002Fsettings\u002Flanguages"," and set your preferred language to ",[14,560,58],{},[64,562,563,566],{},[22,564,565],{},"Network Routing",": Ensure outbound traffic routes through a US egress node so startup handshakes do not immediately report ineligible locations back to Google.",[10,568,569],{},"After relaunching, the familiar Gemini icon will reappear in your address bar and side panel.",[42,571,573],{"id":572},"scope-and-boundaries","Scope and Boundaries",[131,575,576,579],{},[64,577,578],{},"This tweak addresses client-side feature gating in the Chrome binary. If your Google Account itself is restricted due to workspace policies or compliance settings, you still need a personal account with Gemini eligibility enabled.",[64,580,581,582,584],{},"Future major Chrome updates may alter Variations key names or locations, requiring re-inspection of current ",[14,583,27],{}," structures.",[586,587,588],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":173,"searchDepth":195,"depth":195,"links":590},[591,592,593,599],{"id":44,"depth":195,"text":45},{"id":101,"depth":195,"text":102},{"id":147,"depth":195,"text":148,"children":594},[595,596,597,598],{"id":152,"depth":202,"text":153},{"id":245,"depth":202,"text":246},{"id":320,"depth":202,"text":321},{"id":521,"depth":202,"text":522},{"id":572,"depth":195,"text":573},"coder","2026-11-05","Why Chrome's built-in Ask Gemini side panel (glic) disappears due to Variations country pinning, and how to safely edit Local State without memory dump overwrites.","md",null,{},"\u002Fen\u002Fblog\u002Frestore-chrome-ask-gemini-by-modifying-local-state",{"title":5,"description":602},"restore-chrome-ask-gemini-by-modifying-local-state","publish","en\u002Fblog\u002Frestore-chrome-ask-gemini-by-modifying-local-state",[612,613,51,614],"Chrome","Gemini","Browser Tricks","ofJDHsbkpV8YmSHMZpSzbGBasrNcTTS-PUdMkFtW7VE",[604,617],{"title":618,"path":619,"stem":620,"slug":621,"date":622,"children":-1},"Goodbye \"Use Mac Preview for Now\": Antigravity 2.28.0 Brings Built-in PDF Viewer and Browser","\u002Fen\u002Fblog\u002Fantigravity-2-28-0-builtin-pdf-viewer-browser","en\u002Fblog\u002Fantigravity-2-28-0-builtin-pdf-viewer-browser","antigravity-2-28-0-builtin-pdf-viewer-browser","2026-10-28",1793891963998]