What is Content Security Policy?
Content Security Policy (CSP) is a security standard that helps prevent cross-site scripting (XSS) attacks by controlling which resources can be loaded on your website. If your site uses CSP headers, you’ll need to configure them to allow the Molin AI widget to function properly.Required CSP directives
Directive | Value | Purpose |
---|---|---|
script-src | 'self' https://widget.molin.ai | JavaScript execution for the widget |
frame-src | 'self' https://widget.molin.ai | Iframes and embedded content |
style-src | 'self' 'unsafe-inline' https://widget.molin.ai | Widget stylesheets and inline styles |
connect-src | 'self' wss://molin.ai wss://widget.molin.ai https://widget.molin.ai | API and WebSocket connections |
img-src | 'self' https://widget.molin.ai | Widget images and assets |
media-src | https://widget.molin.ai | Audio files for notifications |
Complete CSP policy
Testing your CSP
After implementing CSP headers:- Open your browser’s developer console
- Load a page with the Molin widget
- Check for any CSP violation errors
- Verify the widget appears and functions correctly