fix: remove foreignObject from bubble canvas clone to prevent tainted canvas#321
Merged
takaokouji merged 1 commit intodevelopfrom Mar 16, 2026
Merged
Conversation
… canvas The cloned bubble canvas contained <foreignObject> elements with HTML <textarea> for comment editing. When the SVG is loaded via blob URL, these cause a SecurityError (tainted canvas) on canvas.toBlob(). Remove foreignObject elements from the clone since the visible comment text is already in <text> elements. Fixes #319 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🚀 Preview deployed: https://smalruby.jp/smalruby3-editor/fix/screenshot-tainted-canvas/ |
github-actions bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
…t-tainted-canvas fix: remove foreignObject from bubble canvas clone to prevent tainted canvas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<foreignObject>要素(コメント編集用<textarea>)が含まれていたforeignObject内の HTML がクロスオリジンコンテンツとして扱われ、canvas.toBlob()でSecurityError: Tainted canvases may not be exportedが発生foreignObject要素を除去して解決(表示テキストは<text>要素に既にあるため影響なし)Changes
packages/scratch-gui/src/lib/blocks-screenshot.js: バブルキャンバスクローンからforeignObjectを除去packages/scratch-gui/test/unit/lib/blocks-screenshot.test.js:foreignObject除去のテスト追加Definition of Done
Fixes #319
🤖 Generated with Claude Code