Releases: KevinnZou/compose-webview-multiplatform
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-bundle
and 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
1.3.0
Starting from this version, we switched from JavaFX to the Java CEF Browser for better performance and user experience.
This is a breaking change, and we strongly recommend upgrading to this version as soon as possible.
Note: After switching to JCEF, developers need to configure it for the desktop app. Please see the README.desktop.md for more details.
What's Changed
- Use CEF Browser on Desktop by @DatL4g in #7
- Feature: Custom user agent support. by @Shabinder in #12
New Contributors
- @DatL4g made their first contribution in #7
- @Shabinder made their first contribution in #12
Full Changelog: 1.2.0...1.3.0
1.2.0
New Features
- Support Javascript Evaluation
- Support custom Web settings
What's Changed
- Feature/expand web capbility by @KevinnZou in #5
- Feature/expand web capbility by @KevinnZou in #6
Full Changelog: 1.1.0...1.2.0