{"id":27791370,"url":"https://github.com/winterreisender/webviewko","last_synced_at":"2025-04-30T19:00:09.417Z","repository":{"id":42203920,"uuid":"508626353","full_name":"Winterreisender/webviewko","owner":"Winterreisender","description":"webview for Kotlin Multiplatform, a tiny cross-platform webview library for desktop. ","archived":false,"fork":false,"pushed_at":"2023-10-04T08:12:00.000Z","size":11110,"stargazers_count":58,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-30T19:00:04.598Z","etag":null,"topics":["java","jvm","kotlin","kotlin-js","kotlin-multiplatform","kotlin-native","swing","webui","webview"],"latest_commit_sha":null,"homepage":"https://winterreisender.github.io/webviewko/","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/Winterreisender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-06-29T09:26:50.000Z","updated_at":"2025-04-07T14:25:13.000Z","dependencies_parsed_at":"2023-02-17T17:45:32.205Z","dependency_job_id":"2f65ffd2-b069-4479-9adc-e2a39fe4e597","html_url":"https://github.com/Winterreisender/webviewko","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Winterreisender%2Fwebviewko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Winterreisender%2Fwebviewko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Winterreisender%2Fwebviewko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Winterreisender%2Fwebviewko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Winterreisender","download_url":"https://codeload.github.com/Winterreisender/webviewko/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251767210,"owners_count":21640467,"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","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":["java","jvm","kotlin","kotlin-js","kotlin-multiplatform","kotlin-native","swing","webui","webview"],"created_at":"2025-04-30T19:00:09.305Z","updated_at":"2025-04-30T19:00:09.394Z","avatar_url":"https://github.com/Winterreisender.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webviewko\n\n![Kotlin](https://img.shields.io/badge/Kotlin%2FJVM-7F52FF?logo=kotlin\u0026logoColor=FFFFFF)\n![Kotlin](https://img.shields.io/badge/Kotlin%2FNative-262D3A?logo=kotlin\u0026logoColor=FFFFFF)\n![Kotlin](https://img.shields.io/badge/Kotlin%2FJS-339933?logo=kotlin\u0026logoColor=FFFFFF)\n![license](https://img.shields.io/github/license/Winterreisender/webviewko?color=3DA639)\n![release](https://img.shields.io/github/v/release/Winterreisender/webviewko?label=release\u0026include_prereleases)\n[![gradle ci](https://github.com/Winterreisender/webviewko/actions/workflows/gradle-ci.yml/badge.svg)](https://github.com/Winterreisender/webviewko/actions/workflows/gradle-ci.yml)\n![last commit](https://img.shields.io/github/last-commit/Winterreisender/webviewko)\n\n\u003c!-- \nSee [RFC4646](https://www.ietf.org/rfc/rfc4646.txt), [W3C language tags](https://www.w3.org/International/articles/language-tags/#bytheway) and [iana](https://www.iana.org/assignments/language-subtag-registry)\n--\u003e\n\n**English** | [中文(简体)](docs/README.zh-Hans.md)\n\nwebviewko provides a Kotlin Multiplatform binding to [webview](https://github.com/webview/webview), a tiny cross-platform webview library to build modern cross-platform desktop GUIs using [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/), WebKit and [WebKitGTK](https://webkitgtk.org/).\n\n---\n\n**Looking for Developers to Take Over This Project**  \nUnfortunately, due to my busy schedule during graduate school and my loss of interest in the Kotlin technology, I am no longer willing to maintain this project.  \nIf anyone is interested in taking over the maintenance of this project, please contact me by submitting an issue. I will hand over the development of this project to you.\n\n---\n\n![screenshot](docs/media/screenshot.jpg)\n\n## Getting Started\n\n### 1. Import webviewko\n\nIf you're using a build system like Gradle or Maven, it's recommended to import webviewko via [GitLab Packages](https://gitlab.com/Winterreisender/webviewko/-/packages/). \n\nFor `build.gradle.kts`, just use:\n\n```kotlin {3}\nrepositories {\n    mavenCentral()\n    maven(\"https://gitlab.com/api/v4/projects/38224197/packages/maven\")\n}\n\nimplementation(\"com.github.winterreisender:webviewko:0.6.0\")            // Kotlin Multiplatform\nimplementation(\"com.github.winterreisender:webviewko-jvm:0.6.0\")        // Kotlin/JVM and Java\nimplementation(\"com.github.winterreisender:webviewko-linuxx64:0.6.0\")   // Kotlin/Native Linux x64\nimplementation(\"com.github.winterreisender:webviewko-mingwx64:0.6.0\")   // Kotlin/Native Windows x64\nimplementation(\"com.github.winterreisender:webviewko-macosx64:0.6.0\")   // Kotlin/Native macOS x64\nimplementation(\"com.github.winterreisender:webviewko-js:0.5.0\")         // Kotlin/JS Node.js\n```\n\n- [Additional steps](https://github.com/Winterreisender/webviewko/wiki/How-to-Import#using-gradle-with-kotlinnative) are required for Kotlin/Native in Linux. \n- If you are using `JitPack.io` please move `maven(\"https://jitpack.io\")` below `maven(\"https://gitlab.com/api/v4/projects/38224197/packages/maven\")`\n\n### 2. Use webviewko\n\n```kotlin\nimport com.github.winterreisender.webviewko.WebviewKo\n\nWebviewKo().run {\n    title(\"Title\")\n    size(800, 600)\n    url(\"https://example.com\")\n    show()\n}\n```\n\n### 3. Interact with webview\n\nYou can use `bind`,`init`,`dispatch` and `eval` to interact with your webview:\n\n```kotlin\nimport com.github.winterreisender.webviewko.WebviewKo\n\nWebviewKo(1).run {\n  title(\"Test\")\n  init(\"\"\"console.log(\"Hello, from  init\")\"\"\")\n  bind(\"increment\") {\n    val r :Int = it.removePrefix(\"[\\\"\").removeSuffix(\"\\\"]\").toInt() + 1\n    println(r.toString())\n    if(r==8)\n      terminate()\n    \"{count: $r}\"\n  }\n  html(\"\"\"\n              \u003cbutton id=\"increment\"\u003eTap me\u003c/button\u003e\n              \u003cdiv\u003eYou tapped \u003cspan id=\"count\"\u003e0\u003c/span\u003e time(s).\u003c/div\u003e\n              \u003cscript\u003e\n              const [incrementElement, countElement] = document.querySelectorAll(\"#increment, #count\");\n                document.addEventListener(\"DOMContentLoaded\", () =\u003e {\n                  incrementElement.addEventListener(\"click\", () =\u003e {\n                    window.increment(countElement.innerText).then(result =\u003e {\n                      countElement.textContent = result.count; });});});\n               \u003c/script\u003e\"\"\")\n  show()\n}\n```\n\n## Help\n\n- [API Reference](https://winterreisender.github.io/webviewko/docs/kdoc/index.html)\n- [GitHub Wiki](https://github.com/Winterreisender/webviewko/wiki)\n- Examples\n  - [Test](https://github.com/Winterreisender/webviewko/blob/main/src/commonTest/kotlin/Test.kt) (Kotlin Multiplatform)\n  - [TestKt](https://github.com/Winterreisender/webviewko/blob/main/src/jvmTest/kotlin/TestKt.kt) (Kotlin/JVM)\n  - [TestJava](https://github.com/Winterreisender/webviewko/blob/main/src/jvmTest/java/TestJava.java) (Java)\n  - [TestJS](https://github.com/Winterreisender/webviewko/blob/main/src/jsTest/kotlin/TestJS.kt) (Kotlin/JS)\n  - [TestNative](https://github.com/Winterreisender/webviewko/blob/main/src/nativeTest/kotlin/TestNative.kt) (Kotlin/Native)\n- [webview Documentation](https://webview.dev/)\n- Demo: A CLI Tool [Winterreisender/webviewkoCLI](https://github.com/Winterreisender/webviewkoCLI)\n\n## Contribution\n\nAll suggestions, pull requests, issue and other contributions are welcome and appreciated.\n\n## Credits\n\n| Project                                                                      | License                                                                                          |\n|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|\n| [webview](https://github.com/webview/webview)                                | [MIT](https://github.com/webview/webview/blob/master/LICENSE)                                    |\n| [webview_java](https://github.com/webview/webview_java)                      | [MIT](https://github.com/webview/webview_java/blob/main/LICENSE.md)                              |\n| [webview-nodejs](https://github.com/Winterreisender/webview-nodejs)          | [Apache-2.0](https://github.com/Winterreisender/webview-nodejs/blob/master/LICENSE)              |\n| [node-ffi-napi](https://github.com/node-ffi-napi/node-ffi-napi)              | [MIT](https://github.com/node-ffi-napi/node-ffi-napi/blob/master/LICENSE)                        |\n| [JNA](https://github.com/java-native-access/jna)                             | [LGPL-2.1-or-later OR Apache-2.0](https://github.com/java-native-access/jna/blob/master/LICENSE) |\n| [Microsoft Webview2](https://www.nuget.org/packages/Microsoft.Web.WebView2/) | [BSD-style](https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.1245.22/License)           |\n| [Kotlin \u0026 kotlinx](https://kotlinlang.org/)                                  | [Apache-2.0](https://github.com/JetBrains/kotlin/blob/master/LICENSE)                            |\n\n## License\n\n```text\nCopyright 2022 Winterreisender and other contributors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinterreisender%2Fwebviewko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinterreisender%2Fwebviewko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinterreisender%2Fwebviewko/lists"}