{"id":22549143,"url":"https://github.com/datl4g/kcef","last_synced_at":"2025-08-20T20:33:01.317Z","repository":{"id":197465335,"uuid":"698702432","full_name":"DatL4g/KCEF","owner":"DatL4g","description":"Kotlin implementation of jcefmaven with more modern setup and depending on JetBrains/jcef","archived":false,"fork":false,"pushed_at":"2025-04-01T10:06:45.000Z","size":4942,"stargazers_count":63,"open_issues_count":10,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T20:50:11.671Z","etag":null,"topics":["cef","jcef","jcef-maven","kcef","kotlin","kotlin-library"],"latest_commit_sha":null,"homepage":"https://datl4g.github.io/KCEF/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DatL4g.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"DatL4g","patreon":"datlag","custom":["paypal.me/datlag"]}},"created_at":"2023-09-30T17:44:35.000Z","updated_at":"2025-04-01T01:53:04.000Z","dependencies_parsed_at":"2024-04-20T13:54:52.376Z","dependency_job_id":"537a65a1-1014-46e9-924a-30490d55d90f","html_url":"https://github.com/DatL4g/KCEF","commit_stats":null,"previous_names":["datl4g/kcef"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/DatL4g/KCEF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatL4g%2FKCEF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatL4g%2FKCEF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatL4g%2FKCEF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatL4g%2FKCEF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DatL4g","download_url":"https://codeload.github.com/DatL4g/KCEF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatL4g%2FKCEF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378689,"owners_count":24749195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cef","jcef","jcef-maven","kcef","kotlin","kotlin-library"],"created_at":"2024-12-07T16:07:58.619Z","updated_at":"2025-08-20T20:33:00.873Z","avatar_url":"https://github.com/DatL4g.png","language":"Kotlin","funding_links":["https://github.com/sponsors/DatL4g","https://patreon.com/datlag","paypal.me/datlag","https://github.com/sponsors/DATL4G","https://paypal.me/datlag"],"categories":[],"sub_categories":[],"readme":"# KCEF\n\n**Kotlin equivalent of jcefmaven with a more modern setup and depending on JetBrains/jcef**\n\nVisit the JCEF repo at [JetBrains/jcef](https://github.com/JetBrains/jcef) and the jcefmaven repo at [jcefmaven/jcefmaven](https://github.com/jcefmaven/jcefmaven/)\n\n## Supports\n\nPlease take a look at [JetBrains/JetBrainsRuntime](https://github.com/JetBrains/JetBrainsRuntime/releases) for a full list of supported targets.\n\n| OS | Arch |\n|----|------|\n|![Linux](https://cdn.simpleicons.org/linux/000/fff)    | amd64, aarch64 |\n|![Windows](https://cdn.simpleicons.org/windows/000/fff)| amd64, aarch64 |\n|![MacOS](https://cdn.simpleicons.org/macos/000/fff)    | amd64, aarch64 |\n\n## Installation\n\n### Repository\n\nThis library is published to [Maven Central](https://mvnrepository.com/artifact/dev.datlag/kcef).\n\n```gradle\nrepositories {\n    mavenCentral()\n    maven(\"https://jogamp.org/deployment/maven\")\n}\n```\n\n### Version\n\nThe version depends on [JetBrains/JetBrainsRuntime](https://github.com/JetBrains/JetBrainsRuntime/releases) and [JetBrains/jcef](https://github.com/JetBrains/jcef).\n\nTake a look at the [releases](https://github.com/DATL4G/KCEF/releases) for more details.\n\n#### Kotlin DSL\n\n```kotlin\ndependencies {\n    implementation(\"dev.datlag:kcef:$version\")\n    \n    // or with version catalog\n    implementation(libs.kcef)\n}\n```\n\n#### Version catalog\n\n```toml\n[versions]\nkcef = \"2023.10.11.1\" # put your wanted version here\n\n[libraries]\nkcef = { group = \"dev.datlag\", name = \"kcef\", version.ref = \"kcef\" }\n```\n\n## Usage\n\nView Compose specific usage here [COMPOSE](COMPOSE.md)\n\n### Initialize\n\nIt's recommended to initialize `KCEF` directly after starting the application.\n\nThis way users don't have to wait when the `CefBrowser` is used in another UI page.\n\n\u003cdetails open\u003e\n\u003csummary\u003eKotlin\u003c/summary\u003e\n\nThis is recommended to be called in a **Coroutine** with **IO** scope.\n\n```kotlin\nKCEF.init(\n    builder = {\n        progress {\n            onDownloading {\n                println(\"Download progress: $it%\")\n            }\n        }\n        release(true)\n    }\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eJava\u003c/summary\u003e\n\nThis is recommended to be called in a **IO** Thread.\n\n```java\nKCEF.initBlocking(\n    new KCEFBuilder().progress(\n        new KCEFBuilder.InitProgress.Builder().onDownloading(progress -\u003e {\n            System.out.println(\"Download progress: \" + progress + \"%\");\n        }).build()\n    ).release(true),\n    throwable -\u003e {\n        if (throwable != null) {\n            throwable.printStackTrace();\n        }\n    },\n    () -\u003e {\n        System.out.println(\"Restart required\");\n    }\n);\n```\n\n\u003c/details\u003e\n\n### Create client\n\n\u003cdetails open\u003e\n\u003csummary\u003eKotlin\u003c/summary\u003e\n\nIf you listen to the `onInitialized` progress in the `KCEF.init` method, you can get the client blocking on the **Main** Thread.\n\n```kotlin\nif (initialized) {\n    val client = KCEF.newClientBlocking()\n}\n```\n\nOtherwise, you should run this in a Coroutine which is not using the **Main** scope.\n\n```kotlin\nKCEF.newClient()\n```\n\nThe above methods may throw a `CefException`, you can use the nullable equivalent instead.\n\n```kotlin\nif (initialized) {\n    val client: KCEFClient? = KCEF.newClientOrNullBlocking { throwable -\u003e\n        throwable?.printStackTrace()\n    }\n}\n```\n\n```kotlin\n/** Needs to be called in  a coroutine */\nval client: KCEFClient? = KCEF.newClientOrNull { throwable -\u003e\n    throwable?.printStackTrace()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eJava\u003c/summary\u003e\n\nIf you listen to the `onInitialized` progress in the `KCEF.init` method, you can get the client blocking on the **Main** Thread.\n\n```java\nif (initialized) {\n    KCEFClient client = KCEF.newClientBlocking();\n}\n```\n\nOtherwise, you should run this in a new Thread.\n\n```java\n/** Run in a new Thread */\nKCEFClient client = KCEF.newClientBlocking();\n```\n\nThe above methods may throw a `CefException`, you can use the nullable equivalent instead.\n\n```java\nif (initialized) {\n    KCEFClient client = KCEF.newClientOrNullBlocking(throwable -\u003e {\n        if (throwable != null) {\n            throwable.printStackTrace();\n        }\n    });\n}\n```\n\n```java\n/** Should be called in a new Thread */\nKCEFClient client = KCEF.newClientOrNullBlocking(throwable -\u003e {\n    if (throwable != null) {\n        throwable.printStackTrace();\n    }\n});\n```\n\n\u003c/details\u003e\n\n### Dispose\n\nIf the `CefClient` is no longer used, make sure to dispose it.\n\n`client.dispose()`\n\nIf you no longer need any CEF instance, cleanup up using the `KCEF` class.\n\n`KCEF.disposeBlocking()`\n\nor, if you're not sure if the `KCEF.init` process is finished\n\n`KCEF.dispose()`\n\n## Flags\n\nSome platforms require the addition of specific flags. To use on MacOSX, add the following JVM flags:\n\n```\n--add-opens java.desktop/sun.awt=ALL-UNNAMED\n--add-opens java.desktop/sun.lwawt=ALL-UNNAMED\n--add-opens java.desktop/sun.lwawt.macosx=ALL-UNNAMED\n```\n\nFor gradle project, you can configure it in the build.gradle.kts like that:\n\n```kotlin\nafterEvaluate {\n    tasks.withType\u003cJavaExec\u003e {\n        if (System.getProperty(\"os.name\").contains(\"Mac\")) {\n            jvmArgs(\"--add-opens\", \"java.desktop/sun.awt=ALL-UNNAMED\")\n            jvmArgs(\"--add-opens\", \"java.desktop/sun.lwawt=ALL-UNNAMED\")\n            jvmArgs(\"--add-opens\", \"java.desktop/sun.lwawt.macosx=ALL-UNNAMED\")\n        }\n    }\n}\n```\n\n## ProGuard\n\nIf your application build type uses ProGuard, commonly used for release builds in Java and Kotlin applications, you have to add ProGuard rules for KCEF to work.\n\n```\n-keep class org.cef.** { *; }\n-keep class kotlinx.coroutines.swing.SwingDispatcherFactory\n```\n\n## Support the project\n\n[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA)](https://github.com/sponsors/DATL4G)\n[![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge\u0026logo=paypal\u0026logoColor=white)](https://paypal.me/datlag)\n\n### This is a non-profit project!\n\nSponsoring to this project means sponsoring to all my projects!\nSo the further text is not to be attributed to this project, but to all my apps and libraries.\n\nSupporting this project helps to keep it up-to-date. You can donate if you want or contribute to the project as well.\nThis shows that the library is used by people, and it's worth to maintain.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatl4g%2Fkcef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatl4g%2Fkcef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatl4g%2Fkcef/lists"}