Khan / Khan/live-editor

Processing.js program that displays a getImage cannot be Saved.

Open
#752 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

The one line program
image(getImage("avatars/avatar-team"), 100, 100);
cannot be Saved. The gripe is
Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
at i.getScreenshot (https://cdn.kastatic.org/genwebpack/prod/en/4YZv.6a1ed31e9871d479e50b.js:1:31485)
at i.handleMessage (https://cdn.kastatic.org/genwebpack/prod/en/2Sin.8ae3ec2940569b614452.js:1:5533)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the one-line Processing.js program using getImage("avatars/avatar-team") and attempt to save it. Trace the save flow through the getScreenshot and handleMessage entry points shown in the error, then verify that saving no longer raises the tainted-canvas toDataURL exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.