DEV Community

NirmalSankalana
NirmalSankalana

Posted on

Answer: Script Tag Not Executing Inside Shopify App Embed Block

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:

  1. Move JavaScript code to a separate file in the assets directory of your theme.
  2. Reference the JavaScript file

Top comments (0)