Commit 84221c1
committed
docs: add CORS & external resources guidance to README
External stylesheets (Font Awesome, Google Fonts, etc.) often load font
files from CDNs. Even though the page renders correctly in the browser,
SnapDOM's Canvas-based capture fails to draw those fonts or icons unless
the resources are served with proper CORS headers. This is due to Canvas
security policies that block reading cross-origin binary data — a
behavior we confirmed while testing icon fonts with embedFonts:true.
Add a new "CORS & External Resources" section under Usage that explains:
- Why CORS headers are required for external fonts and icons.
- How to fix it by adding `crossorigin="anonymous"` to the `<link>` tag.
- That same-origin assets (e.g., localhost) do not need this attribute.
This addresses a common pitfall for new users and reduces debugging
overhead, especially for those coming from html2canvas or dom-to-image.1 parent e1fb59e commit 84221c1
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
194 | 217 | | |
195 | 218 | | |
196 | 219 | | |
| |||
0 commit comments