diff --git a/.github/codeql-config-js.yml b/.github/codeql-config-js.yml index 47d5a0f8..ef5c8572 100644 --- a/.github/codeql-config-js.yml +++ b/.github/codeql-config-js.yml @@ -12,8 +12,7 @@ queries: # Paths to exclude from analysis paths-ignore: - "**/node_modules/**" - # Vendored third-party libraries (preact, htm, es-module-shims), copied - # verbatim from npm by scripts/update-static-deps.sh. We don't modify or - # control their internals, so findings here aren't actionable from this - # repo -- report upstream instead. - - "pkg/service/soundtouchweb/static/lib/**" + # The minified es-module-shims distribution currently triggers findings in + # third-party code. Keep this exception file-specific so Preact, HTM, and + # future files under static/lib remain covered. + - "pkg/service/soundtouchweb/static/lib/es-module-shims.js" diff --git a/pkg/service/soundtouchweb/browser_compatibility_test.go b/pkg/service/soundtouchweb/browser_compatibility_test.go index 6e336b17..5ea05f5b 100644 --- a/pkg/service/soundtouchweb/browser_compatibility_test.go +++ b/pkg/service/soundtouchweb/browser_compatibility_test.go @@ -74,10 +74,11 @@ func TestPlayerRendersNatively(t *testing.T) { } } -// TestPlayerRendersUnderForcedShimMode exercises the actual old-Safari code -// path -- es-module-shims resolving the same import map and vendored files -// the real app uses -- without needing physical iPadOS 15 hardware. It -// serves a variant of index.html that forces es-module-shims into shimMode +// TestPlayerRendersUnderForcedShimMode exercises es-module-shims resolving the +// same import map and vendored files the real app uses. It does not emulate +// Safari or the production feature-detection loader; those require a target- +// browser canary. The test serves a page that forces es-module-shims into +// shimMode // (see the library's README: shimMode is triggered by // window.esmsInitOptions.shimMode or by using importmap-shim/module-shim // script types), which routes every browser -- including this ordinary diff --git a/pkg/service/soundtouchweb/static/index.html b/pkg/service/soundtouchweb/static/index.html index 94f80daf..9ddef7a2 100644 --- a/pkg/service/soundtouchweb/static/index.html +++ b/pkg/service/soundtouchweb/static/index.html @@ -17,10 +17,10 @@ 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. + subject to browser interventions that can silently drop it). + After initialization, es-module-shims inspects module graphs that fail + static linking, so browsers without import maps can resolve the bare + imports below without penalizing native-capable ones. -->