This commit is contained in:
33333-33333 2026-08-08 15:31:31 +09:00
commit 28591233f3
85 changed files with 946 additions and 267 deletions

View file

@ -1,6 +1,6 @@
"use strict";
const APP_VERSION = "39.18.3";
const APP_VERSION = "39.18.18";
const CACHE_NAME = `tarinai-colony-${APP_VERSION}`;
const v = `v=${APP_VERSION}`;
// Static runtime list synchronized with app_manifest.json for this release.
@ -19,6 +19,12 @@ const mediaAssetNames = [
"assets/objects/zunchi.webp",
"assets/objects/zunchi_02.webp",
"assets/sounds/achievement_unlock.mp3",
"assets/sounds/acquired_stress_001.wav",
"assets/sounds/acquired_stress_002.wav",
"assets/sounds/acquired_stress_003.wav",
"assets/sounds/acquired_stress_004.wav",
"assets/sounds/acquired_stress_005.wav",
"assets/sounds/acquired_stress_006.wav",
"assets/sounds/bicycle_bell.mp3",
"assets/sounds/firecracker_explosion.mp3",
"assets/sounds/major_damage_01.wav",
@ -36,6 +42,14 @@ const mediaAssetNames = [
"assets/sounds/voice_007_sunbath_pokapoka.wav",
"assets/sounds/voice_008_temperature_buruburu.wav",
"assets/sounds/voice_009_temperature_achui.wav",
"assets/sounds/intimidate_alt_001.wav",
"assets/sounds/ochibi_sleep_002.wav",
"assets/sounds/ochibi_sleep_003.wav",
"assets/sounds/ochibi_fight_hit_004.wav",
"assets/sounds/ochibi_panic_005.wav",
"assets/sounds/ochibi_electric_006.wav",
"assets/sounds/ochibi_hot_007.wav",
"assets/sounds/ochibi_stress_008.wav",
"assets/sprites/tarinai_01_smile.webp",
"assets/sprites/tarinai_02_angry.webp",
"assets/sprites/tarinai_03_teary.webp",
@ -75,9 +89,12 @@ const mediaAssetNames = [
"assets/sprites/tarinai_37_cold_01.webp",
"assets/sprites/tarinai_38_cold_02.webp",
"assets/sprites/tarinai_39_cold_03.webp",
"assets/sprites/tarinai_40_intimidate_alt.webp",
"assets/sprites/tarinai_acquired_overlay.png",
"assets/ui/apple-touch-icon.png",
"assets/ui/ecology_hp_stress.webp",
"assets/ui/favicon.png",
"assets/ui/tool_acquired_tarinai.webp",
"assets/ui/tool_ammo.webp",
"assets/ui/tool_ant_nest.webp",
"assets/ui/tool_ball.webp",
@ -173,10 +190,13 @@ self.addEventListener("fetch", event => {
if (isStaticAsset(request)) {
const responsePromise = caches.match(request).then(async cached => {
if (cached) return cached;
// Media are precached at their canonical URL. Match versioned and unversioned
// requests to the same entry so dynamically requested assets remain offline-safe.
const canonical = await caches.match(request, { ignoreSearch: true });
if (canonical) return canonical;
// Media are precached at their canonical URL. JS/CSS query versions must not
// resolve to an older cached file, otherwise UI fixes can remain stale.
const isCodeAsset = /\.(?:js|css)$/i.test(url.pathname);
if (!isCodeAsset) {
const canonical = await caches.match(request, { ignoreSearch: true });
if (canonical) return canonical;
}
const response = await fetch(request);
await putCacheSafely(request, response);
return response;