If your website sends a Content-Security-Policy header (or a <meta http-equiv="Content-Security-Policy"> tag), the browser will block the Raffle widget unless the policy allows it. Add the four entries below.
Content-Security-Policy
<meta http-equiv="Content-Security-Policy">
script-src https://cdn.raffle.ai; style-src https://cdn.raffle.ai; connect-src https://searchcfg.raffle.ai https://search-backend.raffle.ai; img-src data:;
Add them to your existing directives — do not replace them. If your policy has no script-src (or style-src, or connect-src) of its own, the browser falls back to default-src, so add https://cdn.raffle.ai there instead.
script-src
style-src
connect-src
default-src
https://cdn.raffle.ai
script-src https://cdn.raffle.ai
style-src https://cdn.raffle.ai
connect-src https://searchcfg.raffle.ai
connect-src https://search-backend.raffle.ai
img-src data:
Raffle needs no unsafe-inline, unsafe-eval, font-src, worker-src or frame-src entry of its own.
unsafe-inline
unsafe-eval
font-src
worker-src
frame-src
The install snippet in Script wraps the tag in an inline <script> block, which a strict policy refuses. Use the plain tag instead — it behaves identically:
<script>
<script id="raffle-sdk-v2" type="module" data-uid="tool_id" src="https://cdn.raffle.ai/search-v2/index.js"></script>
Put your nonce on the Raffle tag and keep 'strict-dynamic' in your script-src:
'strict-dynamic'
script-src 'nonce-YOUR_NONCE' 'strict-dynamic';
<script id="raffle-sdk-v2" type="module" nonce="YOUR_NONCE" data-uid="tool_id" src="https://cdn.raffle.ai/search-v2/index.js"></script>
A nonce without 'strict-dynamic' is not enough: the widget loads its application in a second request, which carries no nonce. In that case allow https://cdn.raffle.ai in script-src as well.
style-src and connect-src always need the hosts above, nonce or not.
Open a page with the widget on it, then the browser console. Blocked resources are reported as “Refused to load…” or "…violates the following Content Security Policy directive", and the message names the directive to fix.
You may also see up to three violation reports that Raffle is aware of and that do not stop the widget working: one inline script (a Firefox animation workaround), one empty inline style, and one eval check made by a validation library that falls back safely when it is refused. Allowing them is not necessary.
eval
A CSP applies to the document that sent it, so the policy of the page the widget is installed on is the one that matters. The widget must be installed on the top-level page: inside an <iframe>, it doesn’t start.
<iframe>
Still stuck? Send the policy your site sends, plus the console messages, to Raffle Support.