Can you start with a vanilla setup.
<!DOCTYPE html>
<html>
<head>
<script
src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js"
type="text/javascript">
</script>
</head>
<script>
const textData = "This is from my page";
ThunkableWebviewerExtension.postMessage(textData);
});
</script>
</html>
See if this works then you know it is not the extension. If you save if to .html file and call it from your web viewer
it should give you the result in the receive message
event.