fix print filament color matcher

This commit is contained in:
Rad
2026-04-18 19:50:24 +02:00
parent 6ddce3cfd8
commit 046692dc21
17 changed files with 102171 additions and 107542 deletions

View File

@@ -46,7 +46,33 @@
<link rel="apple-touch-startup-image" href="splash.png">
</head>
<body>
<script src="flutter_bootstrap.js" async></script>
<script>
(async function bootstrapDesktopFlutter() {
if ('serviceWorker' in navigator) {
try {
const registrations = await navigator.serviceWorker.getRegistrations();
await Promise.allSettled(registrations.map((registration) => registration.unregister()));
} catch (error) {
console.warn('Failed to unregister service workers:', error);
}
}
if ('caches' in window) {
try {
const cacheNames = await caches.keys();
const flutterCaches = cacheNames.filter((name) => name.startsWith('flutter-'));
await Promise.allSettled(flutterCaches.map((name) => caches.delete(name)));
} catch (error) {
console.warn('Failed to clear Flutter caches:', error);
}
}
const bootstrapScript = document.createElement('script');
bootstrapScript.src = 'flutter_bootstrap.js';
bootstrapScript.async = true;
document.body.appendChild(bootstrapScript);
})();
</script>
<script>
if ('application/octet-stream' in MimeType) {
@@ -60,7 +86,7 @@
seqid: 1222222,
cmd: "sw_OpenOrcaWebview",
params: {
url: "http://localhost:7357/?locale=zh-cn-CN&dark_model=1&path=/",
url: "http://127.0.0.1:7357/?locale=zh-cn-CN&dark_model=1&path=/",
},
});
// 调用 window.postMessage 传递消息给 flutter