Skip to content

Conversation

@elliots
Copy link
Contributor

@elliots elliots commented Jun 18, 2025

Allows the image crossOrigin to be set per image.

e.g.

  await snapdom(element, {
    imageCrossOrigin: (url: string) => {
      // Use credentials for same-origin images
      if (url.startsWith(window.location.origin)) {
        return "use-credentials";
      }
      // Use anonymous for cross-origin images
      return "anonymous";
    }
  });

@tinchox5
Copy link
Member

@elliots thank you for this PR, I will check and test it before merge! I would prefer just crossOrigin because is shorter, can you change it?

@elliots elliots force-pushed the support-use-credentials-on-images branch from b0f7821 to 49f8ac6 Compare June 18, 2025 22:49
@elliots elliots changed the title add options.imageCrossOrigin add options.crossOrigin Jun 18, 2025
@tinchox5
Copy link
Member

Perfect! Merging..

@tinchox5 tinchox5 merged commit 005f23e into zumerlab:main Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants