Update index.html

Signed-off-by: elseif <elseif@live.cn>
This commit is contained in:
elseif 2025-09-26 13:15:28 +08:00 committed by GitHub
parent 826072d302
commit e338ddb7b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -611,6 +611,10 @@
// GitHub proxy functionality // GitHub proxy functionality
const ghProxyCheckbox = document.getElementById("gh-proxy"); const ghProxyCheckbox = document.getElementById("gh-proxy");
const clearCacheBtn = document.getElementById("clear-cache"); const clearCacheBtn = document.getElementById("clear-cache");
if (localStorage.getItem("gh-proxy-enabled") === null && navigator.language.startsWith("zh")) {
// Enable GitHub proxy by default for Chinese users
localStorage.setItem("gh-proxy-enabled", "true");
}
ghProxyCheckbox.checked = localStorage.getItem("gh-proxy-enabled") === "true"; ghProxyCheckbox.checked = localStorage.getItem("gh-proxy-enabled") === "true";
clearCacheBtn.style.display = ghProxyCheckbox.checked ? "inline-flex" : "none"; clearCacheBtn.style.display = ghProxyCheckbox.checked ? "inline-flex" : "none";