mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-09-07 15:07:17 +00:00
PR #664 rewrote the comment explaining why the dynamically-inserted es-module-shims script sets async = false, replacing the actual execution-order reasoning (it must run before the deferred type="module" script below, without blocking the parser for browsers that never reach this branch) with a vaguer, inaccurate description ("inspects module graphs that fail static linking") that doesn't explain the async choice at all. It also dropped the regression test asserting .async = false is present, so a future "cleanup" removing that line would go uncaught -- and the misleading comment no longer warns against doing so. The actual .async = false code was untouched by #664; this only restores the documentation and its test coverage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
49 lines
2.4 KiB
HTML
49 lines
2.4 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>AfterTouch</title>
|
|
<meta name="description" content="AfterTouch — A replacement for Bose SoundTouch cloud services. Control your speakers after the cloud shutdown." />
|
|
<link rel="icon" type="image/svg+xml" href="/app/static/img/favicon.svg" />
|
|
<link rel="alternate icon" href="/app/static/img/favicon.ico" />
|
|
<link rel="stylesheet" href="/app/static/css/app.css" />
|
|
<!--
|
|
Safari on iPadOS 15 supports native ES modules but not import maps
|
|
(added in Safari 16.4), which left the page blank there (#649).
|
|
es-module-shims polyfills import map support, but it's an ~80KB
|
|
uncompressed download; loading it unconditionally would charge every
|
|
browser that cost on every page view, including the vast majority
|
|
that already support import maps natively. Feature-detect instead,
|
|
so only a browser that actually lacks support ever fetches it.
|
|
Inserted via the DOM rather than document.write (deprecated, and
|
|
subject to browser interventions that can silently drop it), with
|
|
async explicitly set to false so it still executes before the
|
|
deferred `type="module"` script below runs, without blocking the
|
|
parser for the vast majority that never reach this branch.
|
|
-->
|
|
<script>
|
|
if (!(window.HTMLScriptElement && HTMLScriptElement.supports && HTMLScriptElement.supports('importmap'))) {
|
|
var esModuleShimsScript = document.createElement('script');
|
|
esModuleShimsScript.src = '/app/static/lib/es-module-shims.js';
|
|
esModuleShimsScript.async = false;
|
|
document.head.appendChild(esModuleShimsScript);
|
|
}
|
|
</script>
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"preact": "/app/static/lib/preact.module.js",
|
|
"preact/hooks": "/app/static/lib/preact-hooks.module.js",
|
|
"htm": "/app/static/lib/htm.module.js"
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<p style="display:none">Bose SoundTouch Toolkit</p>
|
|
<script type="module" src="/app/static/js/app.js"></script>
|
|
</body>
|
|
</html>
|