Neocities "The page's settings blocked the loading of a resource"
Neocities shows a Content-Security-Policy error when a comment widget or embed loads. Why the header blocks it, how to read the console, and what to try.
The Liite team7 Min. Lesezeit
Short answer
The block comes from a Content-Security-Policy (CSP) header that Neocities' server sends with your pages, so you can't loosen it from your HTML. Read the console to see which domains are refused, then ask Neocities, self-host the file, replace the widget with a plain link, or test another host.
You added a comment widget or an embed to your Neocities page, opened the browser console, and found a CSP error. Firefox words it like this:
Content-Security-Policy: The page's settings blocked the loading of a resource
Chrome and Safari word it differently, but the cause is the same. The widget itself usually isn't broken. The browser is refusing to load it.
Why it happens
A Content-Security-Policy is an HTTP header the server sends along with a page. It tells the browser which sources of scripts, frames, images, styles and connections the page may use. Anything outside the list is refused, and the browser logs a message.
The causes, most common first:
- The host's header doesn't allow the widget's domain. People on the Neocities subreddit report that newer accounts get a stricter CSP header, so third-party scripts such as the Cusdis comment widget are blocked. We could not confirm from Neocities documentation which sources the policy allows or which accounts it applies to. Treat that as a community report, not a confirmed rule.
- The widget loads a second thing. A script may be allowed, but it then calls another domain for data, styles or a frame. That second request can be blocked even when the first one worked.
- Inline code is restricted. If the widget's install snippet is an inline
<script>block, a policy that limits inline scripts refuses it.
The header is set by the server, not by your page, so nothing in your HTML can remove or loosen it. A <meta http-equiv="Content-Security-Policy"> tag can only add restrictions. The browser enforces every policy it sees, so the effective result is never looser than the header.
| Cause | Symptom | Fix |
|---|---|---|
| Domain not in the host's allow list | Console names the script or frame URL | Ask the host, self-host, or move |
| Widget calls a second domain | Widget appears, then stays empty | Check the Network tab for the second request |
| Inline script refused | Error mentions inline script | Move the code to a .js file on your site |
How to check what is blocked
- Open the page, open the browser's developer tools and go to the Console tab.
- Reload the page and look for the CSP messages. Each one names the blocked resource, such as a script URL.
- Open the Network tab, click your page's own request and read its response headers. If a
Content-Security-Policyheader is present, everything you load has to be allowed by it. - Write down the exact domains that are blocked. You need them to decide whether a workaround is possible.
Read the directive
The console message usually names the directive that refused the resource, such as script-src, frame-src or connect-src. That tells you whether the problem is a script, an embedded frame or a data request.
What to try
1. Ask Neocities
The header is theirs, so only they can change what it allows. Check their help pages and support channels for the current policy and whether it can be relaxed for your account. The only forum thread we found (January 2024) had a single reply saying there seemed to be nothing you could do, so check whether that has changed.
2. Self-host what you can
If the blocked item is a script file, a copy on your own site may be allowed where a third-party URL isn't. Steps:
- Download the script file from the widget's documentation.
- Upload it with the rest of your site.
- Change the
srcto your own copy. - Reload and check the console again.
This only works if the script doesn't also call another domain, and a comment widget that stores comments on its own server usually does. Check the license before copying someone's code.
3. Use a plain link
If the widget is a comment box or a form, link to a page on another service instead. A link isn't a loaded resource, so it works under any policy.
4. Pick a host whose headers allow third-party scripts
Test with a small page first and read the console. Some hosts send no restrictive CSP at all, and some let you set your own headers. Check the host's documentation rather than assuming.
Copying scripts
Don't paste a widget's code into your own files without checking its license. A self-hosted copy also won't get the author's later fixes.
What won't help
- Adding a CSP meta tag. It can only tighten the policy.
- Changing the script tag (async, defer, a different
srcpath). The browser blocks by origin, not by how the tag is written. - Clearing the cache or trying another browser. Every browser enforces the same header. Only the wording of the error differs.
- Waiting for the widget's author to fix it. The widget isn't at fault. Your host's policy refuses it.
Checklist before you try again
- The console error names the exact blocked URL, and you have written it down.
- You know which directive refused it (script, frame or connection).
- You have checked whether the widget calls a second domain.
- You have read the host's current help pages on CSP.
- Any copied script is allowed by its license.
If nothing works
Contact Neocities support through the channels on their site. Include the exact console error, the blocked URL, your site address, the browser and version, and what you already tried. A message you can adapt:
Hi, my site [yourname].neocities.org fails to load a third-party script.
Browser console error:
Content-Security-Policy: The page's settings blocked the loading of a resource
Blocked URL: [paste the URL from the console]
Directive: [for example script-src]
I have tried self-hosting the file and checked the console on a clean page.
Is there a way to allow this source for my account, or is the policy fixed?
Thank you.If you move the site
Liite's uploaded sites are served from their own address at <slug>.liite.site, and your own HTML and JavaScript run there. We haven't verified which third-party scripts or embeds work on uploaded sites, so upload a small test page with your widget and read the console before you move anything. Uploaded sites can't run server-side code such as PHP or Node, so a widget that needs its own server is still a separate service.
Put an HTML file, a zip or a PDF online walks through the upload. A Free uploaded site needs a card on file and goes offline 7 days after its last publish, so it suits a test better than a permanent home.
Common questions
Can I override the CSP with a meta tag?
No. A meta tag can only add restrictions. The browser applies the header and the tag together, so the result is never looser than the header.
Why does it work on my computer but not online?
Opening the file locally sends no server header, so no policy applies. The restriction appears only when the host serves the page.
Is the widget broken?
Usually not. The same widget works on hosts whose headers allow its domain. The console message naming your host's policy is the sign it's a refusal, not a bug.
Can I use a different comment system?
Only if its domains are allowed. Check the console for each one you try. If none load, a plain link to a discussion page on another service avoids the problem.