17
Views
1
Comments
Javascript Blob url

Hi everyone,

We are using a JavaScript Blob URL to open a Base64 document in a separate window. However, this may cause CSP issues, and the document's page layout breaks. Could you please suggest any alternative scripts or approaches?


Thanks in advance.

2023-10-16 05-50-48
Shingo Lam

Hi @Vijay Dhasnamoorthy 

CSP is very useful to manage the trusted resource that help your applications / systems avoid attacking.

I think you can add the CSP for self to load your resources, for example, img-src 'self' data: allows images from the same origin and Base64-encoded data URLs. Similarly, object-src 'self' blob: might be needed for Blobs in certain contexts 

Hope this help

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.