TL;DR
CSP is a browser-enforced allowlist for what a page may load and connect to. If a chat widget silently fails to appear on your site, a missing CSP entry is the usual cause.
Key Points
✓
CSP is delivered as the Content-Security-Policy response header and enforced by the browser, not the server [1][2].
✓
Its main purpose is mitigating cross-site scripting: even if an attacker injects a script tag, the browser refuses to run it unless the source is allowlisted [1].
✓
Embedding a chat widget usually needs script-src for the loader, connect-src for its API and [[websocket]] endpoints, and often style-src and img-src.
✓
Content-Security-Policy-Report-Only lets you test a policy and collect violations without breaking the page — always the safe first step [2].
✓
A widget built on [[shadow-dom]] still needs style-src permission, because shadow styles are injected by the same script.
✓
Violations appear in the browser console as blocked-resource errors, which is the fastest way to diagnose an [[embed-code]] that seems to do nothing.
What a CSP actually controls
Making a chat widget work under CSP
Why it comes up so often with live chat
Sources & References
Last updated: August 12, 2026
Related Terms
Embed Code
An embed code is a short snippet of HTML or JavaScript a website owner pastes into their pages so a third-party tool loads and runs on their site. For Eloqra it is a two-line script snippet that sets a project configuration and loads the chat script, which then injects the live-chat widget.
JavaScript Widget
A JavaScript widget is a self-contained chunk of front-end code, loaded from a single script tag, that injects an interactive UI into any third-party web page. In Eloqra it is the live-chat widget that boots from one snippet and renders the chat launcher and conversation panel directly on a customer's site.
Iframe
An iframe (inline frame) is an HTML element that embeds a separate, self-contained HTML document inside the current page, giving the embedded content its own DOM, stylesheets, and JavaScript scope. It is one of the classic ways to drop third-party UI like a chat widget onto a host website without its code clashing with the page.
Shadow DOM
Shadow DOM is a browser API that attaches a hidden, self-contained DOM subtree to an element, with its own scoped styles that neither leak out to the host page nor get overwritten by it. [1] Eloqra renders its entire chat widget inside a shadow root so the host site's CSS can never break the widget, and the widget's CSS can never alter the host site.
WebSocket
WebSocket is a protocol (standardized as RFC 6455) that opens a single, persistent, full-duplex connection between a browser and a server, letting either side push data at any time without re-issuing HTTP requests. It is the transport many real-time apps reach for when they need low-latency, bidirectional messaging.
GDPR Compliance
GDPR compliance means handling the personal data of people in the EU and EEA in line with the General Data Protection Regulation: processing it lawfully, transparently, and securely, and honoring the rights data subjects have over their own data. For a live-chat tool this covers everything from the visitor's name and email to their IP address, location, and chat transcripts.
More in Widget, Integration & Privacy
Put live chat on your site in 30 seconds
Eloqra gives you a lightweight live chat widget that routes every visitor message to your Telegram — free while in early access.
Get Started FreeMore in Widget, Integration & Privacy
View all in Widget, Integration & Privacy →Categories
Learn More
Guides on collecting testimonials, building trust, and turning customer feedback into social proof.
Read the blog →