Prevent Babylon inspector from loading Typekit stylesheet#646
Prevent Babylon inspector from loading Typekit stylesheet#646tracygardner wants to merge 1 commit into
Conversation
The Babylon.js inspector injects a Typekit stylesheet from use.typekit.net when the debug layer is shown. The page CSP only allows style-src 'self' 'unsafe-inline', so this triggers a CSP error in tests.html. The main app already suppresses this via window.BABYLON_SKIP_FONT_LOADING in index.html; apply the same flag to the test harness. https://claude.ai/code/session_01M5UWhT73wZstTixJ59thB7
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a single inline script to ChangesCSP Babylon Font-Loading Workaround
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying flockxr with
|
| Latest commit: |
72e45cb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8885750f.flockxr.pages.dev |
| Branch Preview URL: | https://claude-fix-csp-typekit-error.flockxr.pages.dev |
Summary
Disable Babylon inspector's automatic Typekit font stylesheet injection in the test HTML file to comply with the page's Content Security Policy (CSP).
Changes
window.BABYLON_SKIP_FONT_LOADING = trueconfiguration in a script tag within the<head>oftests/tests.htmlindex.htmlDetails
The Babylon inspector automatically attempts to load a Typekit stylesheet for font rendering. However, this stylesheet URL is blocked by the page's CSP policy. By setting the
BABYLON_SKIP_FONT_LOADINGflag before any Babylon code executes, we prevent this injection and avoid CSP violations while maintaining full inspector functionality.https://claude.ai/code/session_01M5UWhT73wZstTixJ59thB7
Summary by CodeRabbit