iframes have their own javascript context. It's a whole new web page, and you're starting with a completely blank slate. There are no scripting features available whatsoever other than the JavaScript features built in to the browser. Therefore runtime
does not exist, and none of the scripting APIs are available at all. (You're also trying to use await
outside of an async function, which is invalid syntax.)
A normal HTML tag should be able to load an image from a project file in preview in the latest beta. We updated it so network requests to project files work in preview mode.