Skip to content

Chrome 83 download from sandboxed iframes breaks save() functions #1443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jareddonovan opened this issue May 29, 2020 · 8 comments · Fixed by #1457
Closed

Chrome 83 download from sandboxed iframes breaks save() functions #1443

jareddonovan opened this issue May 29, 2020 · 8 comments · Fixed by #1457

Comments

@jareddonovan
Copy link
Contributor

jareddonovan commented May 29, 2020

Nature of issue?

  • Found a bug

Details about the bug:

In Chrome 83, download from sandboxed iframes was removed. This prevents functions such as image.save(), saveCanvas() or saveFrames() from working. According to the Chrome status page below, a flag on the embedded iframe is required to allow this:

chromestatus.com/feature/5706745674465280

  • Web browser and version: Google Chrome | 83.0.4103.61 (Official Build) (64-bit)
  • Operating System: MacOSX 10.15.4
  • Steps to reproduce this bug:
  1. Run the following from the 'sketches' or 'full' views of the p5js web editor (example):
function setup() {
  createCanvas(400, 400);
  background(255, 0, 0);
  saveCanvas('test', 'png');
}
  1. In the developer console, you should see the following message:

image

  1. Run the same code in the 'present' mode and it will work (example)
@Sladix
Copy link

Sladix commented May 29, 2020

Looks like the iframe is missing the allow-downloads value in the sandbox attribute here

sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-forms allow-modals"

@catarak
Copy link
Member

catarak commented May 29, 2020

Thanks for reporting! Hopefully this can be fixed by adding the allow-downloads flag.

@brytlao
Copy link

brytlao commented Jun 15, 2020

This is still an issue. Will the folks at p5js allow downloads?

@catarak
Copy link
Member

catarak commented Jun 15, 2020

This will be fixed for the next release.

@nnja
Copy link

nnja commented Jul 13, 2020

I ran into this issue today as well. Looks like this missed the June 10th release by a few days. Any idea when the next release might be?

I would offer to update the docs for save, saveCanvas, etc to notify users that this functionality currently doesn't work in chrome but it looks like the docs are tied to the code / release schedule.

@catarak
Copy link
Member

catarak commented Jul 13, 2020

@nnja it will be this week!

@catarak
Copy link
Member

catarak commented Jul 13, 2020

@nnja actually I was able to do a release today, so now this is fixed in production 😄

@brytlao
Copy link

brytlao commented Jul 14, 2020

I confirmed that it works. Thank you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants