Answer: Script Tag Not Executing Inside Shopify App Embed Block
NirmalSankalana
Posted on November 2, 2024
After experimenting, I found that Shopify's strict Content Security Policy (CSP) blocks inline JavaScript in certain contexts. The best way to add JavaScript functionality in a Shopify App Embed Block is to:
-
Move JavaScript code to a separate file in the
assets
directory of your theme. - Reference the JavaScript file…
💖 💪 🙅 🚩
NirmalSankalana
Posted on November 2, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.