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.
thanks for your reply. Now another question? will html code running in preview get project files after importing to android? I also noticed a strange iframe bug, when using an iframe with an input field inside, when the mobile keyboard pops up, the iframe goes up and to the right on the mobile phone in scale outer mode without the hide status bar option. If you set the hide status bar option when exporting, everything works fine.