Releases: KevinnZou/compose-webview-multiplatform
1.8.2
1.8.0
New Features
- JsBridge: Starting from version 1.8.0, this library provides a WebViewJsBridge to allow developers to communicate between the WebView and Native. Developers can use the JsBridge to register a handler to handle the message from the WebView.
Please refer to https://github.com/KevinnZou/compose-webview-multiplatform?tab=readme-ov-file#communication-between-webview-and-native for detailed instructions.
What's Changed
- Support communication between Native and JS by @KevinnZou in #73
- feat:Android WebView support custom layer type by @KevinnZou in #74
- feat:Documentation for JsBridge by @KevinnZou in #75
Full Changelog: 1.7.8...1.8.0
1.7.8
What's Changed
- bugfix:Fix navigator.loadHtml error by @KevinnZou in #63
- feat:Android WebView setLayerType LAYER_TYPE_SOFTWARE by @KevinnZou in #65
- feat:Workaround for navigator not working on the Desktop issue. by @KevinnZou in #67
Full Changelog: 1.7.6...1.7.8
1.7.6
New Features
- Support setting zoom level
state.webSettings.apply {
zoomLevel = 2.0
}
What's Changed
- Feature/support zoom level by @KevinnZou in #56
- Feature/support zoom level fix bugs by @KevinnZou in #59
Full Changelog: 1.7.4...1.7.6
1.7.4
What's Changed
- feat:Fix iOS empty cookie bug by @KevinnZou in #49
- Disable popup windows on desktop by @DatL4g in #45
Full Changelog: 1.7.2...1.7.4
1.7.2
Breaking Changes
If you are a developer upgrading from a version lower than 1.7.0 to 1.7.*, please refer to the release note for version 1.7.0 here for upgrade instructions.
New Features
- Support file access from the file Urls. You can config it in WebSettings like this:
webViewState.webSettings.apply {
isJavaScriptEnabled = true
allowFileAccessFromFileURLs = true
allowUniversalAccessFromFileURLs = true
androidWebSettings.apply {
allowFileAccess = true
}
}
What's Changed
- Feature/allow file access by @KevinnZou in #43
Full Changelog: 1.7.0...1.7.2
1.7.0
Breaking Changes
Starting from version 1.7.0, we switched from Java CEF Browser to Kotlin CEF Browser for more features and better performance.
After switching to KCEF, developers need to configure it for the desktop app.
- For new users, just follow this instruction to config the KCEF.
- For developers that upgrade from a lower version, you have to delete the origin
jcef-bundleand update the initialization configuration from CEF to KCEF like below:
LaunchedEffect(Unit) {
withContext(Dispatchers.IO) {
KCEF.init(builder = {
installDir(File("kcef-bundle"))
settings {
cachePath = File("cache").absolutePath
}
}, onError = {
it?.printStackTrace()
}, onRestartRequired = {
})
}
}
DisposableEffect(Unit) {
onDispose {
KCEF.disposeBlocking()
}
}
Jogamp's Maven is also required for KCEF:
repositories {
maven("https://jogamp.org/deployment/maven")
}Please see the README.desktop.md for more details.
New Features
- Upgrade to Compose 1.5.10 and Kotlin 1.9.20
- Support CookieManager for Desktop
- Support custom headers for iOS
What's Changed
- Migrate to KCEF by @DatL4g in #25
- Feature/ktlint support by @KevinnZou in #35
- Feature/ci setup by @KevinnZou in #36
- feat: Support custom headers for iOS request by @KevinnZou in #40
Full Changelog: 1.6.0...1.7.0
1.6.0
New Features
- Local HTML file load support
/**
* Creates a WebView state for HTML file loading that is remembered across Compositions.
*
* @param fileName The file to load in the WebView
* Please note that the file should be placed in the commonMain/resources/assets folder.
* The fileName just need to be the relative path to the assets folder.
*/
@Composable
fun rememberWebViewStateWithHTMLFile(
fileName: String,
): WebViewState =
remember {
WebViewState(WebContent.File(fileName))
}.apply {
this.content = WebContent.File(fileName)
}
Please refer to https://github.com/KevinnZou/compose-webview-multiplatform/blob/main/sample/shared/src/commonMain/kotlin/com/kevinnzou/sample/HtmlWebViewSample.kt for detail example.
- Log Severity Support
webViewState.webSettings.apply {
isJavaScriptEnabled = true
logSeverity = KLogSeverity.Debug
}
By default, logSeverity is set to Info in order to suppress test logs from being printed. If you wish to view them, you can change it to Debug in webSettings.
What's Changed
- Clean logs and create a custom Logger by @KevinnZou in #29
- Support loading local HTML files by @KevinnZou in #28
Full Changelog: 1.5.0...1.6.0
1.5.0
New Features
- Cookie Management.
interface CookieManager {
/**
* Sets a cookie for the given url.
* @param url The url for which the cookie is to be set.
* @param cookie The cookie to be set.
* */
suspend fun setCookie(url: String, cookie: Cookie)
/**
* Gets all the cookies for the given url.
* @param url The url for which the cookies are to be retrieved.
*
* @return A list of cookies for the given url.
* */
suspend fun getCookies(url: String): List<Cookie>
/**
* Removes all the cookies.
* */
suspend fun removeAllCookies()
/**
* Removes all the cookies for the given url.
* @param url The url for which the cookies are to be removed.
* */
suspend fun removeCookies(url: String)
}
Due to some issues with JCEF, we have decided to support Android and iOS platforms at first. Once the KCEF testing is stable, we will switch to it and also support cookies on the Desktop platform.
What's Changed
- Support Cookie management by @KevinnZou in #10
- Reorganize the project structure by @KevinnZou in #22
- Create a Wiki for API documentation by @KevinnZou in #24
Full Changelog: 1.4.0...1.5.0
1.4.0
What's Changed
- CEF Progress listener by @DatL4g in #14
- Support DOM Storage by @KevinnZou in #18
Full Changelog: 1.3.0...1.4.0