Skip to content
Docs: Content Security Policy

Content Security Policy

If your site sends a Content Security Policy, add the app and the picture host to it, or the browser will block the mascot.

What to allow

  • script-src: https://hellosprite.fennec.world, which serves the widget script.
  • connect-src: https://hellosprite.fennec.world, which the widget talks to for answers.
  • img-src: https://hellosprite-cdn.fennec.world, which serves your mascot's poses.
  • style-src: the widget sets its own styles inside its shadow root, so a policy that limits styles needs 'unsafe-inline'.

Add these to the sources your policy already lists. As a header, the relevant part looks like this:

Content-Security-Policy
script-src 'self' https://hellosprite.fennec.world;
connect-src 'self' https://hellosprite.fennec.world;
img-src 'self' https://hellosprite-cdn.fennec.world;
style-src 'self' 'unsafe-inline';

How to tell it is the policy

Open your browser's developer tools on your site and look at the console. A blocked widget shows a message that names the directive that refused it, such as connect-src. Add the host to that directive and reload.