Type to search by title, content, or category

Esc to close, Enter for all results

/ Coder

Restore Missing "Ask Gemini" in Chrome: Local State Fix Guide and Underlying Mechanics

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.

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 chrome://flags or changing the browser UI language to English often fails to bring the icon back.

The proven solution is straightforward: Chrome gates feature access based on the country code persisted in your user profile's Local State file. Changing the persisted regional code from cn to us restores access reliably.

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.

Underlying Mechanics: Why Switching UI to English Fails

Internally, Google refers to this integrated side-panel assistant by the project codename glic (Gemini Live in Chrome).

A common assumption is that changing UI language to 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:

  1. 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.
  2. Local State Persistence: This country code is saved under variations_country and variations_permanent_consistency_country in Local State. As long as these keys remain set to cn, Chrome treats the browser as located in a non-eligible region and hides glic completely.

Note: This article details Chrome profile configurations and Google Variations gating. Make sure you understand the memory flush timing before modifying configuration files.

The Common Pitfall: Why Edits Get Instantly Overwritten

Many tutorials instruct users to open Local State, find cn, replace it with us, and save. But upon restarting Chrome, the icon remains absent—and checking Local State shows us was rewritten back to cn.

The root cause is Chrome's in-memory state dump:

  • 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, instantly overwriting your changes.
  • Consequently, fully terminating all Chrome processes must happen before opening and editing the file.

Step-by-Step Guide

Step 1: Completely Terminate Chrome Processes

Do not merely close the browser window or minimize it; ensure all background helper processes have exited.

macOS Users: Right-click Chrome in the Dock and select "Quit" (Cmd + Q), or terminate it cleanly via terminal:

osascript -e 'quit app "Google Chrome"'
# 检查是否还有残留进程
pgrep -f "Google Chrome" || echo "Chrome 已彻底退出"

Windows Users: Open Task Manager (Ctrl + Shift + Esc) or force-stop leftover processes in PowerShell:

Stop-Process -Name chrome -Force -ErrorAction SilentlyContinue

Step 2: Locate and Back Up the Config File

Local State is a JSON-formatted global configuration file. Always create a backup before modifying it.

  • macOS Path: ~/Library/Application Support/Google/Chrome/Local State
  • Windows Path: %LOCALAPPDATA%\Google\Chrome\User Data\Local State

Create a backup in macOS terminal:

LOCAL_STATE="$HOME/Library/Application Support/Google/Chrome/Local State"
cp "$LOCAL_STATE" "${LOCAL_STATE}.bak"

Step 3: Update Regional Keys

Open Local State in VS Code or any text editor, then locate and update these three keys:

{
  "variations_country": "us",
  "variations_permanent_consistency_country": "us",
  "is_glic_eligible": true
}
  • Change "variations_country" (previously "cn" or another regional code) to "us".
  • Change "variations_permanent_consistency_country" to "us".
  • If "is_glic_eligible" exists in your build, set it to true (if absent, do not add it manually; leave as is).

If you prefer command-line automation, run this safe Python replacement after Chrome is fully closed:

python3 -c '
import json, os

path = os.path.expanduser("~/Library/Application Support/Google/Chrome/Local State")
with open(path, "r", encoding="utf-8") as f:
    data = json.load(f)

data["variations_country"] = "us"
data["variations_permanent_consistency_country"] = "us"
if "is_glic_eligible" in data:
    data["is_glic_eligible"] = True

with open(path, "w", encoding="utf-8") as f:
    json.dump(data, f, ensure_ascii=False)
print("Local State 更新成功")
'

Step 4: Verify Environment and Launch

After saving changes and reopening Chrome, ensure these three prerequisites are met to prevent Google Variations from reverting:

  1. Flags Experiment: Navigate to chrome://flags/, search for glic or gemini, set relevant entries to Enabled, and relaunch.
  2. UI Language: Go to chrome://settings/languages and set your preferred language to English (United States).
  3. Network Routing: Ensure outbound traffic routes through a US egress node so startup handshakes do not immediately report ineligible locations back to Google.

After relaunching, the familiar Gemini icon will reappear in your address bar and side panel.

Scope and Boundaries

  • 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.
  • Future major Chrome updates may alter Variations key names or locations, requiring re-inspection of current Local State structures.