You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
feat: add mirror link fallback
- mostly mean for China user, possible to use all feature except module update
This commit is contained in:
@@ -41,10 +41,11 @@ function downloadFile(targetURL, fileName) {
|
||||
// Function to check for updates
|
||||
export async function updateCheck() {
|
||||
try {
|
||||
const response = await fetch("https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/main/update.json");
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
const response = await fetch("https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/main/update.json")
|
||||
.catch(async () => {
|
||||
return fetch("https://raw.gitmirror.com/KOWX712/Tricky-Addon-Update-Target-List/main/update.json");
|
||||
});
|
||||
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
|
||||
noConnection.style.display = "none";
|
||||
const data = await response.json();
|
||||
remoteVersionCode = data.versionCode;
|
||||
|
||||
Reference in New Issue
Block a user