mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-22 18:32:16 +00:00
fix print filament color matcher
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user