# ReplaceGoogleCDN: Redirecting Google CDN Requests to Domestic Mirrors in Chrome

> A Chrome extension that rewrites Google-hosted front-end libraries, fonts and reCAPTCHA to mirrors reachable from mainland China. It is a request-redirection tool with a fixed rule table, not a proxy.

**justjavac/ReplaceGoogleCDN** — ⚡️ 一个 Chrome 插件：将 Google CDN 替换为国内的。

- Repository: https://github.com/justjavac/ReplaceGoogleCDN
- Website: https://chrome.google.com/webstore/detail/replace-google-cdn/kpampjmfiopfpkkepbllemkibefkiice
- Stars: 3,692 · Forks: 528
- Language: JavaScript
- License: GPL-3.0
- Published: 2026-09-23 · Updated: 2026-09-23 · Language: en
- Canonical page: https://hysenlabs.com/projects/justjavac-replacegooglecdn

## The problem ReplaceGoogleCDN addresses, and who it is for

The README opens with a blunt premise: sites that use Google's CDN to speed themselves up find that the same CDN is the slowest route available from mainland China. The project's stated purpose is to replace Google's CDN with domestic ones, so that a page's front-end dependencies load from a mirror that is reachable. The audience is narrow and well defined. It is developers and site operators who load jQuery, Bootstrap, Google Fonts or reCAPTCHA from Google-hosted endpoints and who need those requests to resolve to something reachable without a proxy. It is not a general-purpose network tool. The mechanism is a browser extension that rewrites requests, so it only affects pages loaded in a browser where the extension is installed. Server-side code, command-line tools and mobile apps gain nothing from it. The README frames the whole thing around one observation: replacing a domain name is enough to keep using Google's public front-end libraries.

## How the redirection works: webRequest in v2, declarativeNetRequest in v3

The README describes the mechanism as request-address redirection implemented through browser APIs. Two generations are named: the v2 webRequest API and the v3 declarativeNetRequest API. That split explains the repository layout, which keeps extension-v2/ and extension/ as separate trees and ships two packaging scripts, release-archive.sh for v2 and release-archive-v3.sh for v3. The rule table is the substance of the project. It maps an original address to a replacement and marks whether the rule is enabled by default. Enabled by default: ajax.googleapis.com to ajax.loli.net, fonts.googleapis.com to fonts.googleapis.cn, themes.googleusercontent.com to themes.loli.net, fonts.gstatic.com to fonts.googleapis.cn, www.google.com/recaptcha to www.recaptcha.net/recaptcha, secure.gravatar.com to gravatar.loli.net, maxcdn.bootstrapcdn.com/bootstrap to lib.baomitu.com/twitter-bootstrap/, and code.jquery.com to a jsdelivr npm path. Disabled by default: cdnjs.cloudflare.com to cdnjs.loli.net, cdn.jsdelivr.net to fastly.jsdelivr.net, developers.google.com to developers.google.cn, developer.android.com to developer.android.google.cn, source.android.com to source.android.google.cn, www.gstatic.com to www.gstatic.cn, cdn.sstatic.net to sstatic.net, and lh3.googleusercontent.com with no replacement listed. The README states that rules are disabled by default in the sense that the options page is where you adjust replacement addresses, and that double-clicking the extension icon opens that options page. The jquery rule is the most interesting entry because it is not a plain domain swap: it rewrites a versioned path into a package-manager path, which means the rule has to parse the version out of the original URL.

## Installing ReplaceGoogleCDN from the store or unpacked

The README lists three online install routes: the Chrome Web Store, Firefox Add-ons and the Edge Add-ons store. For Chrome, the store link is the one named in the homepage field. If the store is unreachable, the README gives a manual path: download the repository archive, unpack it, and load the extension/ subdirectory as an unpacked extension. The steps are Chrome-specific and are quoted here as the README gives them.

```bash
# 1. download https://github.com/justjavac/ReplaceGoogleCDN/archive/master.zip and unpack it
# 2. open chrome://extensions/
# 3. enable Developer Mode
# 4. Load unpacked extension... and select the extension directory
# 5. disable Developer Mode again
```

After loading, the extension appears in the toolbar. Double-clicking its icon opens the options page, which is where replacement addresses are adjusted. The README points to extension/options_ui/README.md for how that page works. A third route uses a Gitee mirror of the source, cloned shallowly, with the same unpacked-extension steps afterward.

```bash
git clone -b master https://gitee.com/jingjingxyk/ReplaceGoogleCDN.git --depth=1 --progress
```

The README also documents an update command for that clone, using git -C on the cloned directory with --depth=1. For contributors, package.json exposes the build and check scripts: release and release-archive.sh for v2 packaging, release-archive-v3.sh for v3, plus rules:check, manifest:check and icons:check, which run Node and Python scripts under test/. The README states that packaging output lands in the dist directory.

## The mirror dependency is the real limitation

Every enabled rule points at a third-party mirror: loli.net, baomitu.com, jsdelivr, recaptcha.net. The extension does not host anything. If a mirror goes away, changes its path scheme, or starts serving a different build of a library, the extension keeps redirecting to it and the page breaks or silently loads something else. That is a supply-chain consideration, and it is worth being explicit: you are trusting a domain you did not choose, on a rule you may not have reviewed. The disabled-by-default rules hint that the maintainers treat some substitutions as situational rather than safe. cdn.jsdelivr.net to fastly.jsdelivr.net is a same-project hostname change, and www.gstatic.com to www.gstatic.cn is a Google-operated domain swap, both left off until the user turns them on. The lh3.googleusercontent.com row has no replacement at all, which suggests no workable mirror was found. There is also a scope limit that the README does not address: the extension rewrites requests in the browser, so anything fetched by a build step, a CI job or a native app is untouched. And because the rule set is a fixed table, a library hosted on a Google endpoint that is not in the table will not be redirected. The README does not document rollback behaviour for a rule that misbehaves beyond disabling it in the options page.

## How it differs from a proxy or a local hosts override

The obvious alternative is a proxy or VPN, and the difference in approach matters. A proxy changes where the traffic exits; the browser still requests the original hostname, and the full path is preserved. ReplaceGoogleCDN changes the hostname itself, so the request never leaves for Google's edge and no proxy is involved. That makes it lighter and usable where a proxy is not available, but it also means the replacement host must actually serve the same resource. A hosts-file override is closer in spirit, since it also redirects by name, but it operates at the DNS layer for the whole machine and cannot rewrite paths. The jquery rule in this project rewrites a path, which a hosts entry cannot do. The trade-off runs the other way too: a hosts override covers every application on the machine, while this extension covers only the browser it is installed in. For a developer who needs the same library from a build script, neither the extension nor a hosts entry is the right shape; a package manager or a bundled copy is.

## Maintenance, licence and upgrade cost

The repository is not archived, and its last push was on 2026-07-06. The most recent tagged release in the list is v0.10.25 from 2023-03-29, with v0.9.0 and v0.8.0 before it in 2021. That gap between the last push and the last release is the thing to weigh: the code moves, but the tagged releases that feed the store listings are older. The README keeps separate changelogs for the v2 and v3 lines, CHANGELOG-v2-x.x.x.md and CHANGELOG-v3-x.x.x.md, so the upgrade path is documented per API generation. The practical upgrade cost sits with the v2 to v3 transition, since the two use different browser APIs and the repository carries both trees. The project is licensed GPL-3.0, which is a copyleft licence; if you fork it, redistribute it or ship a modified version, the licence terms apply to what you distribute. That is a general observation about GPL-3.0, not legal advice, and a fork that only you load unpacked is a different situation from one published to a store.

## Conclusion

ReplaceGoogleCDN suits developers and site operators in mainland China who need Google-hosted front-end libraries, fonts and reCAPTCHA to load without a proxy, and who accept a fixed, editable rule table. It does not suit anyone outside that network situation, anyone who needs a general-purpose proxy, or anyone who wants per-site policy control. Before adopting it, read extension/options_ui/README.md, confirm which mirror domains the enabled rules point at, and check whether the specific library you depend on is covered by the rule list rather than assuming it is.

## FAQ

### What does ReplaceGoogleCDN actually replace?

It redirects requests for Google-hosted front-end resources to domestic mirrors, including ajax.googleapis.com, fonts.googleapis.com, fonts.gstatic.com, themes.googleusercontent.com and Google's reCAPTCHA endpoint. The README lists the full mapping table with a column showing which rules are enabled by default.

### How do I install ReplaceGoogleCDN manually in Chrome?

Download and unpack the repository archive, then open chrome://extensions/, enable Developer Mode, choose Load unpacked extension and select the extension subdirectory. The README notes you can disable Developer Mode afterward.

### Which CDN rules are disabled by default in ReplaceGoogleCDN?

The README marks cdnjs.cloudflare.com, cdn.jsdelivr.net, developers.google.com, developer.android.com, source.android.com, www.gstatic.com and cdn.sstatic.net as not enabled, and lh3.googleusercontent.com has no replacement address listed. You enable them from the options page, which opens when you double-click the extension icon.

### Does ReplaceGoogleCDN work outside Chrome?

The README lists online install routes for Chrome, Firefox and Edge, and the repository keeps a separate extension-v2/ tree alongside extension/ because the two browser API generations differ. The manual unpacked-extension steps in the README are written for Chrome.

## Sources

- [justjavac/ReplaceGoogleCDN on GitHub](https://github.com/justjavac/ReplaceGoogleCDN)
- [License: GPL-3.0](https://github.com/justjavac/ReplaceGoogleCDN/blob/master/LICENSE)
- [Project website](https://chrome.google.com/webstore/detail/replace-google-cdn/kpampjmfiopfpkkepbllemkibefkiice)
- [README](https://github.com/justjavac/ReplaceGoogleCDN/blob/master/README.md)
- [Releases](https://github.com/justjavac/ReplaceGoogleCDN/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/justjavac-replacegooglecdn
