Skip to content

Fix CodePen export failing to inline blob assets on Safari#53

Merged
apresmoi merged 1 commit into
mainfrom
fix-snapshot-blob-export
May 31, 2026
Merged

Fix CodePen export failing to inline blob assets on Safari#53
apresmoi merged 1 commit into
mainfrom
fix-snapshot-blob-export

Conversation

@apresmoi
Copy link
Copy Markdown
Collaborator

Summary

  • exportPolySceneSnapshot inlines blob: atlas/texture assets by fetch()-ing them, which intermittently fails on WebKit/Safari ("Load failed") — so "Open in CodePen" reports could not inline asset "blob:…". This surfaces on mobile, where untextured solids fall to a single <s> atlas slice backed by a blob PNG (desktop uses <i> border-shape, no blob)
  • add an XMLHttpRequest fallback for object URLs (blob:/filesystem:) when fetch() throws — the documented WebKit workaround — and drop the meaningless credentials mode for object-URL requests
  • fetch() stays the primary path for all URLs, so non-Safari behavior is unchanged

Validation

  • pnpm test && pnpm build
  • new unit test: when fetch() rejects for a blob: URL, the exporter falls back to XHR and still produces the inlined data:image/png;base64,…

@apresmoi apresmoi merged commit c43e0ad into main May 31, 2026
1 check passed
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.

1 participant