ebcebac22a6d640a2348eae307a1bab88cc249cb
从 appsail/Gemini-in-Chrome 下载后重写 install.sh / install.ps1: - 原脚本用正则/sed 做“仅替换已存在字段”,字段本不存在时静默不生效 - 改为 JSON 感知读写(jq 优先,探测/自动装失败时降级为 sed+awk 零依赖兜底) - 修复过程中实测发现并修掉的坑:BSD sed 不支持 GNU 的 0,/re/ 插入语法、 正则不容忍冒号后空格导致插入重复 key、macOS 系统自带 bash 3.2 在脚本文件模式下 中文紧跟未加花括号的 $VAR 会解析错位丢字节 - 新增 test-fixtures/ 下完全人工构造(非真实数据脱敏)的多 profile 测试样本
Gemini in Chrome
One-click script to enable Chrome's built-in Gemini AI features for non-US users.
Quick Start
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/appsail/Gemini-in-Chrome/main/install.sh | bash
Windows
Open PowerShell and run:
irm https://raw.githubusercontent.com/appsail/Gemini-in-Chrome/main/install.ps1 | iex
What It Does
- ✅ Checks if Chrome is running (prompts you to close it)
- 💾 Backs up your config (
Local State.bak) - 🔧 Patches these settings:
is_glic_eligible:false→truevariations_country: →usvariations_permanent_consistency_country: →us
- ✓ Verifies changes were applied
Restore Original Config
macOS:
mv ~/Library/Application\ Support/Google/Chrome/Local\ State.bak \
~/Library/Application\ Support/Google/Chrome/Local\ State
Linux:
mv ~/.config/google-chrome/Local\ State.bak \
~/.config/google-chrome/Local\ State
Windows PowerShell:
Move-Item -Path "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State.bak" `
-Destination "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State" -Force
Safety
- Original config is backed up before any changes
- Only modifies local Chrome settings
- No data uploaded, no network access (except downloading the script)
- Easily reversible
- Unofficial, open source, use at your own risk
Config Paths
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Google/Chrome/Local State |
| Linux | ~/.config/google-chrome/Local State |
| Windows | %LOCALAPPDATA%\Google\Chrome\User Data\Local State |
Issues
Found a bug? Open an issue.
License
MIT
Languages
Shell
69.8%
PowerShell
30.2%