<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Content Security Policy at 4.27 requires unsafe-eval? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1320982#M82050</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/37244"&gt;@AnnaWilliams&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;When working with a vanilla ArcGIS JS SDK application, using '&lt;SPAN&gt;wasm-unsafe-eval&lt;/SPAN&gt;' by itself without 'unsafe-eval' works fine in the CSP directive. Are you working with a specific framework&lt;SPAN&gt;? Do you have more information on your error message or could you provide an example of what's not working?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Aug 2023 23:52:47 GMT</pubDate>
    <dc:creator>LaurenBoyd</dc:creator>
    <dc:date>2023-08-21T23:52:47Z</dc:date>
    <item>
      <title>Content Security Policy at 4.27 requires unsafe-eval?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1320405#M82032</link>
      <description>&lt;P&gt;This documentation&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/faq/" target="_blank"&gt;Frequently Asked Questions | Overview | ArcGIS Maps SDK for JavaScript 4.27 | ArcGIS Developers&lt;/A&gt;&amp;nbsp;implies that 'unsafe-eval' is not required in the Content Security Policy while 'wsam-usafe-eval' is required.&amp;nbsp; When I remove 'unsafe-eval' from CSP I get an error in developer console on init.js line 34 saying it is blocked by CSP.&amp;nbsp; The CSP does not allow the use of new Function.&amp;nbsp; Is there a work around for this or do I need to include 'unsafe-eval' in my CSP?&lt;/P&gt;&lt;P&gt;!a("host-webworker") &amp;amp;&amp;amp; a("host-browser") &amp;amp;&amp;amp; (a.add("esri-csp-restrictions", ()=&amp;gt;{&lt;BR /&gt;try {&lt;BR /&gt;new Function&lt;BR /&gt;} catch {&lt;BR /&gt;return !0&lt;BR /&gt;}&lt;BR /&gt;return !1&lt;BR /&gt;}&lt;BR /&gt;),&lt;/P&gt;</description>
      <pubDate>Sat, 19 Aug 2023 12:05:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1320405#M82032</guid>
      <dc:creator>AnnaWilliams</dc:creator>
      <dc:date>2023-08-19T12:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Content Security Policy at 4.27 requires unsafe-eval?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1320982#M82050</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/37244"&gt;@AnnaWilliams&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;When working with a vanilla ArcGIS JS SDK application, using '&lt;SPAN&gt;wasm-unsafe-eval&lt;/SPAN&gt;' by itself without 'unsafe-eval' works fine in the CSP directive. Are you working with a specific framework&lt;SPAN&gt;? Do you have more information on your error message or could you provide an example of what's not working?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 23:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1320982#M82050</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2023-08-21T23:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Content Security Policy at 4.27 requires unsafe-eval?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1321042#M82052</link>
      <description>&lt;P&gt;Thank you for the reply!&amp;nbsp; No special framework.&amp;nbsp; It is a .NET 6 application using an on-premises ArcGIS Server with locally hosted version of the &lt;A href="https://developers.arcgis.com/javascript/latest/install-and-set-up/#amd-modules-via-arcgis-cdn" target="_self"&gt;AMD modules via ArcGIS CDN&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error appearing in the web brower's developer console, indicates a function that is contained in the &lt;A href="https://js.arcgis.com/4.27/init.js" target="_self"&gt;JavaScript API's init.js&lt;/A&gt; file.&amp;nbsp; This does not appear to be breaking anything in my application at this point I will have to do further testing to confirm.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You said your CSP directive worked fine does that mean you did not see any CSP errors in the developer console?&amp;nbsp; or that despite the errors everything worked fine?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 09:39:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1321042#M82052</guid>
      <dc:creator>AnnaWilliams</dc:creator>
      <dc:date>2023-08-22T09:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Content Security Policy at 4.27 requires unsafe-eval?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1660435#M87770</link>
      <description>&lt;P&gt;I know this is an old topic.&lt;/P&gt;&lt;P&gt;But this is exactly what I'm seeing now still.&lt;/P&gt;&lt;P&gt;This code is still present in the &lt;A href="https://js.arcgis.com/4.34/init.js" target="_self"&gt;4.34/init.js&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;r("host-webworker")||r("host-browser")&amp;amp;&amp;amp;(r.add("esri-csp-restrictions",()=&amp;gt;{try{new Function}catch{return!0}return!1})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That 'new Function', though caught in a try/catch, still triggers a CSP error in the browser. And when CSP report is enabled, also creates log entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The map works just fine even when this occurs.&amp;nbsp;Why even test whether there's CSP? What do you do differently when you've detected this? Just be CSP compatible. No unsafe-inline, no unsafe-eval.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:30:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/content-security-policy-at-4-27-requires-unsafe/m-p/1660435#M87770</guid>
      <dc:creator>AlexHaan-iWink</dc:creator>
      <dc:date>2025-10-24T12:30:02Z</dc:date>
    </item>
  </channel>
</rss>

