Oops, downloading failed

I’m attempting to “Download PNG” for a chart I’ve made via Vega-Lite-API, but I’m getting a little red error on top: “Oops, downloading failed.”

“Download SVG” works.

No errors in console. Running Safari on Mac. I’ve been able to do this in the past.

Any ideas?

Perhaps a CORS issue. Can you share the link to your notebook, or alternatively provide a reduced example in which the problem can be reproduced?

I will try to make a reduced example.

Really weirdly, though, in Safari I selected “Disable Cross-Origin Restrictions” and then I was logged out of Observablehq.com and could not log back in. Deselecting returned things to normal.

Perhaps related?

[Error] Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag.
	Mt (index-6c673751.js:7:20381)
	lu (index-6c673751.js:7:90434)
	Ec (index-6c673751.js:7:110536)
	Cc (index-6c673751.js:7:110425)
	bc (index-6c673751.js:7:110278)
	sc (index-6c673751.js:7:107354)
	sc
	(anonymous function) (index-6c673751.js:7:58949)
	(anonymous function) (index-6c673751.js:7:11615)
	ra (index-6c673751.js:7:58895)
	na (index-6c673751.js:7:58830)
	ic (index-6c673751.js:7:104137)
	enqueueSetState (index-6c673751.js:7:62618)
	(anonymous function) (index-6c673751.js:7:2336)
	(anonymous function) (notebook-97fb35b4.js:2:564887)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob

The cell render is SVG, so presumably that’s why SVG works and PNG (which perhaps needs to actually be downloaded) doesn’t?

That shouldn’t matter, because the worker iframe doesn’t initiate a download. Instead, the parent frame (i.e., the editor UI) requests a rendered PNG blob of the cell contents from the worker via postMessage (you can search for request_download to find both the initiator and handler).