Title: How to allow data:text/javascript?
Last modified: August 15, 2025

---

# How to allow data:text/javascript?

 *  Resolved [optimest](https://wordpress.org/support/users/optimest/)
 * (@optimest)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/how-to-allow-datatext-javascript/)
 * I want to allow including javascript in data:text/javascript format. I haven’t
   clicked to disable unsafe-inline. However it gets blocked with the following 
   message. How can I allow it to load?
 * Refused to load the script ‘data:text/javascript;base64,d2luZG93Ll93cGVtb2ppU2V0dGluZ3M9eyJiYXNlVXJsIjoiaHR0cHM6XC9cL3Mudy5vcmdcL2ltYWdlc1wvY29yZVwvZW1vamlcLzE2LjAuMVwvNzJ4NzJcLyIsImV4dCI6Ii5wbmciLCJzdmdVcmwiOiJodHRwczpcL1wvcy53Lm9yZ1wvaW1hZ2VzXC9jb3JlXC9lbW9qaVwvMTYuMC4xXC9zdmdcLyIsInN2Z0V4dCI6Ii5zdmciLCJzb3VyY2UiOnsiY29uY2F0ZW1vamkiOiJodHRwczpcL1wvZGlyZWN0YWRlbnRhbC5jb21cL3dwLWluY2x1ZGVzXC9qc1wvd3AtZW1vamktcmVsZWFzZS5taW4uanM/
   dmVyPTYuOC4yIn19OwovKiEgVGhpcyBmaWxlIGlzIGF1dG8tZ2VuZXJhdGVkICovCiFmdW5jdGlvbihzLG4pe3ZhciBvLGksZTtmdW5jdGl…
   J0c1t0XSk7bi5zdXBwb3J0cy5ldmVyeXRoaW5nRXhjZXB0RmxhZz1uLnN1cHBvcnRzLmV2ZXJ5dGhpbmdFeGNlcHRGbGFnJiYhbi5zdXBwb3J0cy5mbGFnLG4uRE9NUmVhZHk9ITEsbi5yZWFkeUNhbGxiYWNrPWZ1bmN0aW9uKCl7bi5ET01SZWFkeT0hMH19KS50aGVuKGZ1bmN0aW9uKCl7cmV0dXJuIGV9KS50aGVuKGZ1bmN0aW9uKCl7dmFyIGU7bi5zdXBwb3J0cy5ldmVyeXRoaW5nfHwobi5yZWFkeUNhbGxiYWNrKCksKGU9bi5zb3VyY2V8fHt9KS5jb25jYXRlbW9qaT90KGUuY29uY2F0ZW1vamkpOmUud3BlbW9qaSYmZS50d2Vtb2ppJiYodChlLnR3ZW1vamkpLHQoZS53cGVtb2ppKSkpfSkpfSgod2luZG93LGRvY3VtZW50KSx3aW5kb3cuX3dwZW1vamlTZXR0aW5ncyk
   =’ because it violates the following Content Security Policy directive: “script-
   src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ blob: […list of domains….]”. Note that‘
   script-src-elem’ was not explicitly set, so ‘script-src’ is used as a fallback.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [9 months ago](https://wordpress.org/support/topic/how-to-allow-datatext-javascript/#post-18633622)
 * ‘unsafe-inline’ means that inline scripts like, javascript: URLs, and inline 
   event handlers are allowed.
 * The problem is that there is now allow function for data:; and I will address
   this in the next version.
 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [8 months, 4 weeks ago](https://wordpress.org/support/topic/how-to-allow-datatext-javascript/#post-18638656)
 * When it is done, would you like to try a beta of the plugin [@optimest](https://wordpress.org/support/users/optimest/)?
 *  Thread Starter [optimest](https://wordpress.org/support/users/optimest/)
 * (@optimest)
 * [8 months, 4 weeks ago](https://wordpress.org/support/topic/how-to-allow-datatext-javascript/#post-18638668)
 * Sure.
 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [8 months ago](https://wordpress.org/support/topic/how-to-allow-datatext-javascript/#post-18669711)
 * Apologies for not sending you the beta, it’s now been included in the latest 
   version.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How to allow data:text/javascript?’ is closed to new replies.

 * ![](https://ps.w.org/cookies-and-content-security-policy/assets/icon-256x256.
   png?rev=2414719)
 * [Cookies and Content Security Policy](https://wordpress.org/plugins/cookies-and-content-security-policy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookies-and-content-security-policy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookies-and-content-security-policy/)
 * [Active Topics](https://wordpress.org/support/plugin/cookies-and-content-security-policy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookies-and-content-security-policy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookies-and-content-security-policy/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * Last activity: [8 months ago](https://wordpress.org/support/topic/how-to-allow-datatext-javascript/#post-18669711)
 * Status: resolved