Software⏱️ 2 min read📅 2026-05-31

How to Fix: Content Security Policy "data" not working for base64 Images in Chrome 28

CSP 'data' keyword issue in Chrome 28

Quick Answer: The problem is that the CSP 'data' keyword only applies to inline scripts, not images. To fix this, use the 'img-src' directive instead of 'data' and specify the allowed sources for images.

To resolve the Content Security Policy (CSP) issue with base64 images in Chrome 28, follow these steps:

🛠️ Step-by-Step Verified Fixes

Method 1: Using the img-src Directive

  1. Step 1: Update your CSP header to include the img-src directive with the 'data' keyword, like so: meta http-equiv='Content-Security-Policy' content='default-src 'self'; img-src data:
  2. Step 2: Save and reload your page to apply the changes.

Method 2: Using the base-uri Attribute

  1. Step 1: Update your HTML to include the base-uri attribute on the img tag, like so: ✨ Wrapping Up

    By implementing one of these methods, you should be able to resolve the CSP issue and successfully load base64 images in Chrome 28.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions