Practical Implications
The Content Security Policy enforced on Greenhouse Games has direct implications for how you structure and develop your game. This page breaks down what’s allowed, what’s blocked, and how to work within the constraints.All Assets Must Be Bundled Locally
The CSP restricts resource loading to'self' (same-origin) for most directives. This means:
- Scripts, stylesheets, fonts, and images must be included in your ZIP bundle — they cannot be loaded from external CDNs or third-party servers.
- References to Google Fonts, Font Awesome CDN, Bootstrap CDN, or any external host will be blocked at runtime.
- Include all dependencies directly in your bundle’s file structure.
Inline Scripts and Styles Are Permitted
Thescript-src directive includes 'unsafe-inline' and 'unsafe-eval', and style-src includes 'unsafe-inline'. This means:
- Inline
<script>tags work normally. - Inline
<style>tags andstyleattributes work normally. eval()andnew Function()are permitted by CSP (thoughevalandFunctionconstructor are flagged by the separate security scan — see Blocked APIs).- Dynamic style injection via JavaScript (e.g.,
element.style.color = 'red') works as expected.
Even though CSP permits
eval(), the platform’s security scan still flags it as a blocked API. The CSP allows it to avoid breaking legitimate game engines that use code generation patterns, but direct use of eval will result in a security finding.Blob URLs Are Permitted
The CSP allowsblob: URLs in several directives (script-src, connect-src, img-src, frame-src, worker-src). This means:
- You can dynamically create scripts, images, and workers from Blob objects.
URL.createObjectURL()works for generating runtime content.- This is useful for game engines that compile or generate code/assets at runtime.
Network Requests Are Restricted to Same-Origin
Theconnect-src 'self' blob: directive means:
fetch(),XMLHttpRequest, andWebSocketcan only connect to same-origin endpoints.- Any request to an external domain will be blocked by the browser.
- This includes analytics services, telemetry endpoints, multiplayer servers, and ad networks.
Web Workers Must Be Same-Origin or Blob URLs
Theworker-src 'self' blob: directive means:
- Workers loaded from local files in your bundle work normally.
- Workers created from blob URLs (dynamically generated) work normally.
- Workers loaded from external URLs are blocked.
localStorage, sessionStorage, and Cookies Are Blocked
While not directly controlled by CSP, the platform’s JavaScript API restrictions block access to:localStorage— blocked by security scansessionStorage— blocked by security scandocument.cookie— blocked by security scan

