window.WebView object is not available / not injected

According to the Kodular Web Viewer documentation, See here

In the WebViewer, you include Javascript that references the window.Kodular object, using the methods getWebViewString() and setWebViewString(text)

So i think your JS should do things like,

      window.Kodular.setWebViewString("hello from JS");
      let s = window.Kodular.getWebViewString();

If instead you are trying window.WebView or window.WebView.setWebViewString(...), that won’t work because the injected interface is named Kodular

In older App Inventor / related stacks, people often used window.AppInventor.setWebViewString(...)

See here

1 Like