Skip to content

Failed to retrieve image from external source due to CORS #3240

@Imran-imtiaz48

Description

@Imran-imtiaz48

I'm using html2canvas on Domain A, and I've set the useCORS: true option to enable cross-origin image loading. However, when the script tries to load an image hosted on Domain B, I encounter the following error:

Access to image at <Domain B> from origin <Domain A> has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

In the Network tab, I can see that the response from Domain B does not include the Access-Control-Allow-Origin header. Since the image request is made internally by html2canvas, I assumed that setting useCORS: true would handle this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions