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.
📋 Table of Contents
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
- Step 1: Update your CSP header to include the
img-srcdirective with the'data'keyword, like so:meta http-equiv='Content-Security-Policy' content='default-src 'self'; img-src data: - Step 2: Save and reload your page to apply the changes.
Method 2: Using the base-uri Attribute
- Step 1: Update your HTML to include the
base-uriattribute on theimgtag, 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.
❓ Frequently Asked Questions
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:Step 2: Save and reload your page to apply the changes.
Step 1: Update your HTML to include the base-uri attribute on the img tag, like so: Step 2: Save and reload your page to apply the changes.
By implementing one of these methods, you should be able to resolve the CSP issue and successfully load base64 images in Chrome 28.
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Pc crashes shortly after launching game, possible cause: outdated grap
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: FPS drops
FPS drops in games can be caused by high system resource usage, outdat