I have a widget published to be used in ArcGIS Enterprise. When plotting a PNG image as a MediaLayer I receive the error that the blob: is not allowed in the Content Security Policy (CSP). The same error occurs with a GeoJSON layer (pointing to an "in-memory" GeoJSON). The native "Add data" widget also fails when adding a local .geojson file - the layer doesn't load. I tested it on Chrome and Safari with the same failure.
Is there an alternative to use them?
Chrome error:
Refused to load the image 'blob:<URL>' because it violates the following Content Security Policy directive: "img-src * data:". Note that '*' matches only URLs with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme matches `self`'s scheme. The scheme 'blob:' must be added explicitly.
PS: the fail doesn't happen when the same widget is used inside an application from the ExB developer. It happens only when using it on ArcGIS Enterprise ExB.
Thanks for the post! Could you also provide any additional information, such as sample data, screenshots, or recordings? Thanks!
Hi @TianWen, the error happens with my custom widget but the easiest way to check the error is by using the native "Add data" widget as shown below:
1 - In ArcGIS Enterprise, create a new ExB application, and add the "Add data" widget:
2 - Using the widget in the preview:
3 - Add a GeoJSON layer (it happens for PNG URL images as well):
4 - The layer is added but no data is displayed. See the error in the console:
Note: Enterprise 11.3.