
Embeds host WebView into declarative UI, exposing a compact common API for loading pages, observing URL/loading state, driving navigation — uses native WebView instead of bundling Chromium.
Language: English | 简体中文
| Artifact | Latest version |
|---|---|
core |
|
jsbridge |
| Platform artifact | Latest version |
|---|---|
platform-windows |
|
platform-linux |
|
platform-macos |
wvbridge is a Compose Multiplatform library that embeds the host platform WebView and
exposes a small, Kotlin-friendly common API for loading pages, observing URL and loading state
changes, and driving basic browser navigation.
Documentation site: wvbridge.kagg886.top
Note: This project is under active development. APIs and platform coverage may change.
Add the common API to your shared source set:
repositories {
mavenCentral()
}
kotlin {
sourceSets {
commonMain.dependencies {
implementation("top.kagg886.wvbridge:core:<version>")
}
}
}On JVM, wvbridge also needs a platform-specific native runtime library. The recommended approach is
to use Google's os-detector Gradle plugin and choose the runtime artifact from
osdetector.classifier.
plugins {
id("com.google.osdetector") version "1.7.3"
}
repositories {
mavenCentral()
}
kotlin {
jvm()
sourceSets {
jvmMain.dependencies {
val platform = when (osdetector.classifier) {
"windows-x86_64" -> "platform-windows"
"linux-x86_64" -> "platform-linux"
"osx-aarch_64" -> "platform-macos"
else -> error(
"Unsupported JVM runtime for wvbridge: ${osdetector.classifier}. " +
"Supported classifiers are windows-x86_64, linux-x86_64, and osx-aarch_64."
)
}
runtimeOnly("top.kagg886.wvbridge:$platform:<version>")
}
}
}Current JVM native runtime support is limited to:
windows-x86_64
linux-x86_64
osx-aarch_64
Create a remembered controller and render WebView:
import androidx.compose.ui.Modifier
import top.kagg886.wvbridge.WebView
import top.kagg886.wvbridge.rememberWebViewController
val webViewController = rememberWebViewController("https://example.com")
WebView(
controller = webViewController,
modifier = Modifier,
)Basic navigation uses webViewController.navigator:
webViewController.navigator.loadUrl("https://kotlinlang.org")
webViewController.navigator.goBack()
webViewController.navigator.goForward()
webViewController.navigator.refresh()
webViewController.navigator.stop()More features are documented at wvbridge.kagg886.top.
Legend: ✅ Implemented; ❌ Not implemented;
| Feature | Android | iOS | Windows JVM | Linux JVM | macOS JVM |
|---|---|---|---|---|---|
| Basic navigation (forward, back, load, stop, refresh) | ✅ | ✅ | ✅ | ✅ | ✅ |
| URL listener | ✅ | ✅ | ✅ | ✅ | ✅ |
| Loading state listener | ✅ | ✅ | ✅ | ✅ | ✅ |
| Synchronous JS execution | ✅ | ✅ | ✅ | ✅ | ✅ |
| Add page script (document-start hook) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Listen for events sent from native | ✅ | ✅ | ✅ | ✅ | ✅ |
| Auto destroy on error | 🚧 | 🚧 | 🚧 | ✅ | 🚧 |
| Off-screen rendering | ✅ System capability | 🧪 | ❌ | ❌ | ❌ |
Language: English | 简体中文
| Artifact | Latest version |
|---|---|
core |
|
jsbridge |
| Platform artifact | Latest version |
|---|---|
platform-windows |
|
platform-linux |
|
platform-macos |
wvbridge is a Compose Multiplatform library that embeds the host platform WebView and
exposes a small, Kotlin-friendly common API for loading pages, observing URL and loading state
changes, and driving basic browser navigation.
Documentation site: wvbridge.kagg886.top
Note: This project is under active development. APIs and platform coverage may change.
Add the common API to your shared source set:
repositories {
mavenCentral()
}
kotlin {
sourceSets {
commonMain.dependencies {
implementation("top.kagg886.wvbridge:core:<version>")
}
}
}On JVM, wvbridge also needs a platform-specific native runtime library. The recommended approach is
to use Google's os-detector Gradle plugin and choose the runtime artifact from
osdetector.classifier.
plugins {
id("com.google.osdetector") version "1.7.3"
}
repositories {
mavenCentral()
}
kotlin {
jvm()
sourceSets {
jvmMain.dependencies {
val platform = when (osdetector.classifier) {
"windows-x86_64" -> "platform-windows"
"linux-x86_64" -> "platform-linux"
"osx-aarch_64" -> "platform-macos"
else -> error(
"Unsupported JVM runtime for wvbridge: ${osdetector.classifier}. " +
"Supported classifiers are windows-x86_64, linux-x86_64, and osx-aarch_64."
)
}
runtimeOnly("top.kagg886.wvbridge:$platform:<version>")
}
}
}Current JVM native runtime support is limited to:
windows-x86_64
linux-x86_64
osx-aarch_64
Create a remembered controller and render WebView:
import androidx.compose.ui.Modifier
import top.kagg886.wvbridge.WebView
import top.kagg886.wvbridge.rememberWebViewController
val webViewController = rememberWebViewController("https://example.com")
WebView(
controller = webViewController,
modifier = Modifier,
)Basic navigation uses webViewController.navigator:
webViewController.navigator.loadUrl("https://kotlinlang.org")
webViewController.navigator.goBack()
webViewController.navigator.goForward()
webViewController.navigator.refresh()
webViewController.navigator.stop()More features are documented at wvbridge.kagg886.top.
Legend: ✅ Implemented; ❌ Not implemented;
| Feature | Android | iOS | Windows JVM | Linux JVM | macOS JVM |
|---|---|---|---|---|---|
| Basic navigation (forward, back, load, stop, refresh) | ✅ | ✅ | ✅ | ✅ | ✅ |
| URL listener | ✅ | ✅ | ✅ | ✅ | ✅ |
| Loading state listener | ✅ | ✅ | ✅ | ✅ | ✅ |
| Synchronous JS execution | ✅ | ✅ | ✅ | ✅ | ✅ |
| Add page script (document-start hook) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Listen for events sent from native | ✅ | ✅ | ✅ | ✅ | ✅ |
| Auto destroy on error | 🚧 | 🚧 | 🚧 | ✅ | 🚧 |
| Off-screen rendering | ✅ System capability | 🧪 | ❌ | ❌ | ❌ |