-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run on the wasmJs platform #205
Comments
Hello, I would like to ask when the wasmJs platform will be supported. I encountered an error when running on the wasmJs platform. The error message indicates that it cannot find the library for the js platform. Here is the error message:
|
@MoYeRanqianzhi Thanks for your feedback. Currently, we only have a PR that has empty support for WasmJs. It just makes this lib build successfully on the WasmJs platform. However, the web content will not display properly on it. Since I am not an expert on the WasmJs side, I am afraid that we can only wait for someone to create the real implementation for it. I am sorry for that. You are welcome to build upon the PR above to support WasmJs. Thanks! |
@KevinnZou Thank you, this way at least it won't cause the wasmJs platform to fail to run. For the implementation method on the wasmJs platform, I think maybe using the IFrame tag might work. |
@KevinnZou I think this method can work. Just display the WebView at the top layer and adjust its position and size to make it appear at the specified location. style.css html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
.over {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
z-index: 9999;
}
.over .component {
pointer-events: auto;
}
} index.html <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TinySoftware</title>
<link type="text/css" rel="stylesheet" href="styles.css">
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
<div class="over" id="webview"></div>
</body>
</html> main.kt @OptIn(ExperimentalComposeUiApi::class)
fun main() {
document.getElementById("webview")!!.appendChild(
document.createElement("web").apply {
innerHTML = "<iframe src=\"https://moyeranqianzhi.github.io\" width=\"500\" height=\"500\"></iframe>"
}
)
ComposeViewport(document.body!!) {
App()
}
} |
No description provided.
The text was updated successfully, but these errors were encountered: