Print & photo functions with new custom widget

Hello there,

I test the new custom widget tool. Looks nice, seems easy to work with. Since I assume that it will become the standard for new custom widgets, I plan to migrate there over time.

So far, I found only two problems

  • Print window: We create printable documents that are either exported as a pdf or printed directly. With the old widget and vibe coding, that worked without issues. Now it seems to be blocked and I can only use the built-in version of Grist.
  • Similar thing with photos. We use some widgets as small web apps and make photos of things (like inventory). We can make a photo but can’t save it.

Are these behaviours intentional?

@Till thanks for this feedback! Just took a look. The new Widget Creator puts widget code in an iframe with sandbox=“allow-scripts” only, so the browser blocks window.print(), popups, downloads and form submits. Regular custom widgets are rendered secure by different means. Will look at what we can do to improve things.

Thanks, much appreciated. I’m looking forward to it.

A possible approach: keep the sandbox but add a small host bridge. The widget could post a request via postMessage, and the parent page performs the print, download, or photo-save action. Regular custom widgets may already support something similar; documenting which actions are allowed would help widget authors plan migrations. For photos, a file input plus host-side save might avoid the form-submit restriction.