Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3a178d9
add support for iOS isInspectable property vis webSettings and apply …
sebastiangl May 9, 2025
4fe61a1
Ktlint fix
sebastiangl May 12, 2025
06d3c82
Merge pull request #305 from sebastiangl/main
KevinnZou May 20, 2025
79322f4
feat: add run configurations for Android and iOS
amirghm May 25, 2025
2c12722
Update Kotlin, AGP, Compose, and other dependencies
amirghm May 25, 2025
ef9bc8f
docs: update KMM to KMP
amirghm May 25, 2025
1719910
Fix: Load local HTML files with KCEF on desktop
amirghm May 25, 2025
93da2bc
Fix: Add ObjCSignatureOverride for WKNavigationDelegate methods
amirghm May 25, 2025
3bb9b76
Updated fileChoose.html and index.html sample with better ui
amirghm May 25, 2025
5533fd7
Refactor: Unify content loading for all platforms
amirghm May 25, 2025
ff1c4a0
Fix: TopAppBar overlap with status bar in sample app for sdk 36+
amirghm May 25, 2025
ff0ff0f
feat: Introduce `WebViewFileReadType` for flexible HTML file loading
amirghm May 26, 2025
b35d28c
Deprecate rememberWebViewStateWithHTMLFile without readType
amirghm May 26, 2025
523d81e
feat: Introduce wasmJs target for KMP WebView
amirghm May 27, 2025
85d58e8
Update version to 2.0.0
amirghm May 27, 2025
91bb5fd
Merge branch 'KevinnZou:main' into feature/add-wasmjs-support
amirghm May 27, 2025
0bd9353
Update README.desktop.md
amirghm May 27, 2025
c147377
Update Ktlint versions (to 1.6.0) to match to the latest kotlin version
amirghm May 27, 2025
53938b9
Update Ktlint versions (to 1.6.0) to match to the latest kotlin version
amirghm May 27, 2025
694a756
Merge remote-tracking branch 'origin/feature/add-wasmjs-support' into…
amirghm May 27, 2025
09e8e83
Fix: Adjust sample app UI for edge-to-edge display
amirghm May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ sample/desktopApp/cache
sample/desktopApp/DawnCache
sample/desktopApp/GPUCache
sample/desktopApp/*.log
site
site
/.kotlin
74 changes: 74 additions & 0 deletions .run/androidApp.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="androidApp" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
<module name="compose-webview-multiplatform.sample.androidApp" />
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
<option name="DEPLOY_AS_INSTANT" value="false" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ALL_USERS" value="false" />
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
<option name="CLEAR_APP_STORAGE" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="RESTORE_ENABLED" value="false" />
<option name="RESTORE_FILE" value="" />
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<option name="DEBUGGER_TYPE" value="Auto" />
<Auto>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Auto>
<Hybrid>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Hybrid>
<Java>
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Java>
<Native>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Native>
<Profilers>
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
<option name="STARTUP_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY" value="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
<method v="2">
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
42 changes: 21 additions & 21 deletions .run/desktopApp.run.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/sample/desktopApp" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="run" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/sample/desktopApp" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="run" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
11 changes: 11 additions & 0 deletions .run/iosApp.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration name="iosApp" CONFIG_VERSION="1" EXEC_TARGET_ID="B611C1CD-2B48-439C-99F1-7D42CFADF467"
XCODE_CONFIGURATION="Debug" XCODE_PROJECT="$PROJECT_DIR$/sample/iosApp/iosApp.xcodeproj"
XCODE_SCHEME="iosApp"
default="false" factoryName="iOS Application"
type="KmmRunConfiguration">
<method v="2">
<option name="com.jetbrains.kmm.ios.BuildIOSAppTask" enabled="true" />
</method>
</configuration>
</component>
23 changes: 23 additions & 0 deletions .run/wasmJsApp.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="wasmJsApp" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/sample/wasmJsApp" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="wasmJsBrowserDevelopmentRun" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
1 change: 1 addition & 0 deletions README.desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Please use the following example as a reference.

```kotlin
fun main() = application {
addTempDirectoryRemovalHook()
Window(onCloseRequest = ::exitApplication) {
var restartRequired by remember { mutableStateOf(false) }
var downloading by remember { mutableStateOf(0F) }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class GreetJsMessageHandler : IJsMessageHandler {
"Greet Handler Get Message: $message"
}
val param = processParams<GreetModel>(message)
val data = GreetModel("KMM Received ${param.message}")
val data = GreetModel("KMP Received ${param.message}")
callback(dataToJsonString(data))
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ subprojects {

// Optionally configure plugin
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
version.set("1.0.1")
version.set("1.6.0")
filter {
exclude("**/generated/**")
include("**/kotlin/**")
Expand Down
4 changes: 2 additions & 2 deletions docs/communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MaterialTheme {
onClick = {
webViewNavigator.evaluateJavaScript(
"""
document.getElementById("subtitle").innerText = "Hello from KMM!";
document.getElementById("subtitle").innerText = "Hello from KMP!";
""".trimIndent(),
) {
// handle the result
Expand Down Expand Up @@ -89,7 +89,7 @@ class GreetJsMessageHandler : IJsMessageHandler {
"Greet Handler Get Message: $message"
}
val param = processParams<GreetModel>(message)
val data = GreetModel("KMM Received ${param.message}")
val data = GreetModel("KMP Received ${param.message}")
callback(dataToJsonString(data))
}
}
Expand Down
10 changes: 3 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2
#Android
android.useAndroidX=true
android.compileSdk=34
android.targetSdk=34
android.compileSdk=36
android.targetSdk=36
android.minSdk=21
#Versions
kotlin.version=1.9.23
agp.version=8.1.1
compose.version=1.7.1
coroutines.version=1.8.0
GROUP=io.github.kevinnzou
POM_ARTIFACT_ID=compose-webview-multiplatform
VERSION_NAME=1.9.40
VERSION_NAME=2.0.0
POM_NAME=Compose WebView Multiplatform
POM_INCEPTION_YEAR=2023
POM_DESCRIPTION=WebView for JetBrains Compose Multiplatform
Expand Down
26 changes: 14 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
[versions]
agp = "8.1.1"
compose = "1.7.1"
kotlin = "1.9.23"
coroutines = "1.8.0"
voyager = "1.0.0-rc10"
agp = "8.9.3"
compose = "1.8.0"
kotlin = "2.1.20"
coroutines = "1.10.2"
voyager = "1.1.0-beta01"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
compose-multiplatorm = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dokka = "org.jetbrains.dokka:1.9.0"
kotlin-atomicfu = { id = "org.jetbrains.kotlin.plugin.atomicfu", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ktlint = "org.jlleitschuh.gradle.ktlint:11.6.1"
ktlint = "org.jlleitschuh.gradle.ktlint:12.3.0"
maven-publish = "com.vanniktech.maven.publish:0.25.3"

[libraries]
android-activity-compose = "androidx.activity:activity-compose:1.8.2"
android-appcompat = "androidx.appcompat:appcompat:1.6.1"
android-webkit = "androidx.webkit:webkit:1.10.0"
compose-navigation = "org.jetbrains.androidx.navigation:navigation-compose:2.8.0-alpha08"
android-activity-compose = "androidx.activity:activity-compose:1.10.1"
android-appcompat = "androidx.appcompat:appcompat:1.7.0"
android-webkit = "androidx.webkit:webkit:1.13.0"
compose-navigation = "org.jetbrains.androidx.navigation:navigation-compose:2.8.0-alpha13"
material-icons-core = "org.jetbrains.compose.material:material-icons-core:1.7.3"
kcef = "dev.datlag:kcef:2024.04.20.3"
kermit = "co.touchlab:kermit:2.0.3"
kotlin-atomicfu = "org.jetbrains.kotlinx:atomicfu:0.23.2"
kotlin-atomicfu = "org.jetbrains.kotlinx:atomicfu:0.27.0"
kotlin-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlin-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" }
kotlin-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0"
kotlin-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1"
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
voyager-tabNavigator = { module = "cafe.adriel.voyager:voyager-tab-navigator", version.ref = "voyager" }
Loading