{"id":37214993,"url":"https://github.com/vikulin/webview","last_synced_at":"2026-01-15T00:52:28.058Z","repository":{"id":57573649,"uuid":"352179322","full_name":"vikulin/webview","owner":"vikulin","description":"Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)","archived":false,"fork":true,"pushed_at":"2022-12-18T09:10:12.000Z","size":5903,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-06-20T12:50:14.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"webview/webview","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vikulin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-27T21:19:07.000Z","updated_at":"2021-10-22T18:24:54.000Z","dependencies_parsed_at":"2023-01-29T18:45:55.093Z","dependency_job_id":null,"html_url":"https://github.com/vikulin/webview","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vikulin/webview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikulin%2Fwebview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikulin%2Fwebview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikulin%2Fwebview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikulin%2Fwebview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vikulin","download_url":"https://codeload.github.com/vikulin/webview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikulin%2Fwebview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-15T00:52:27.338Z","updated_at":"2026-01-15T00:52:28.050Z","avatar_url":"https://github.com/vikulin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webview\n\n[![Join the chat at https://gitter.im/zserge/webview](https://badges.gitter.im/zserge/webview.svg)](https://gitter.im/zserge/webview?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Build Status](https://img.shields.io/github/workflow/status/webview/webview/CI%20Pipeline)](https://github.com/webview/webview)\n[![GoDoc](https://godoc.org/github.com/webview/webview?status.svg)](https://godoc.org/github.com/webview/webview)\n[![Go Report Card](https://goreportcard.com/badge/github.com/webview/webview)](https://goreportcard.com/report/github.com/webview/webview)\n\nA tiny cross-platform webview library for C/C++/Go to build modern cross-platform GUIs.\n\nThe goal of the project is to create a common HTML5 UI abstraction layer for the most widely used platforms.\n\nIt supports two-way JavaScript bindings (to call JavaScript from C/C++/Go and to call C/C++/Go from JavaScript).\n\n## Platform Support\n\nPlatform | Technologies\n-------- | ------------\nLinux    | [GTK 3][gtk], [WebKitGTK][webkitgtk]\nmacOS    | Cocoa, [WebKit][webkit]\nWindows  | [Windows API][win32-api], [WebView2][ms-webview2]\n\n## Documentation\n\nWe have started working on publishing documentation at [webview.dev] but you can always find the most up-to-date documentation right in the source code. Improving the documentation is a continuous effort and you are more than welcome to [offer suggestions][issues-new] or [contribute with content][docs-repo]. Please bear with us if the latest updates are not yet published.\n\n## Prerequisites\n\nYour compiler must support minimum C++11 except for platforms that require a more modern version.\n\n### Linux and BSD\n\nThe [GTK][gtk] and [WebKit2GTK][webkitgtk] libraries are required for development and distribution. You need to check your package repositories regarding how to install those those.\n\nDebian-based systems:\n\n* Packages:\n  * Development: `apt install libgtk-3-dev libwebkit2gtk-4.0-dev`\n  * Production: `apt install libgtk-3-0 libwebkit2gtk-4.0-37`\n\nBSD-based systems:\n\n* FreeBSD packages: `pkg install webkit2-gtk3`\n* Execution on BSD-based systems may require adding the `wxallowed` option (see [mount(8)](https://man.openbsd.org/mount.8))  to your fstab to bypass [W^X](https://en.wikipedia.org/wiki/W%5EX \"write xor execute\") memory protection for your executable. Please see if it works without disabling this security feature first.\n\n### Windows\n\nYour compiler must support C++17 and we recommend to pair it with an up-to-date Windows 10 SDK.\n\nFor Visual C++ we recommend Visual Studio 2022 or later. We have a [separate section for MinGW-w64](#mingw-w64-requirements).\n\nDevelopers and end-users must have the [WebView2 runtime][ms-webview2-rt] installed on their system for any version of Windows before Windows 11.\n\n## Getting Started\n\nIf you are a developer of this project then please go to the [development section](#development).\n\nInstructions here are written for GCC when compiling C/C++ code using Unix-style command lines, and assumes that you run multiple commands in the same shell. Use the Command shell on Windows with these instructions rather than PowerShell. See the [MinGW-w64 requirements](#mingw-w64-requirements) when building on Windows.\n\nYou will have a working app but you are encouraged to explore the [available examples][examples] and try the ones that go beyond the mere basics.\n\nStart with creating a new directory structure for your project:\n\n```sh\nmkdir my-project \u0026\u0026 cd my-project\nmkdir build libs \"libs/webview\"\n```\n\n### Windows Preperation\n\nThe [WebView2 SDK][ms-webview2-sdk] is required when compiling programs:\n\n```bat\nmkdir libs\\webview2\ncurl -sSL \"https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2\" | tar -xf - -C libs\\webview2\ncopy /Y libs\\webview2\\build\\native\\x64\\WebView2Loader.dll build\n```\n\n\u003e **Note:** `WebView2Loader.dll` must be distributed along with your app unless you link it statically, in which case you must use Visual C++ for compilation.\n\n\u003e **Note:** All of the examples here assume that you are targeting `x64` so make sure to specify the correct path for WebView2 depending on what you are targeting.\n\n### C/C++ Preparation\n\nFetch the webview library:\n\n```sh\ncurl -sSLo \"libs/webview/webview.h\" \"https://raw.githubusercontent.com/webview/webview/master/webview.h\"\ncurl -sSLo \"libs/webview/webview.cc\" \"https://raw.githubusercontent.com/webview/webview/master/webview.cc\"\n```\n\n### Getting Started with C++\n\nSave the basic C++ example into your project directory:\n\n```sh\ncurl -sSLo basic.cc \"https://raw.githubusercontent.com/webview/webview/master/examples/basic.cc\"\n```\n\nBuild and run the example:\n\n```sh\n# Linux\ng++ basic.cc -std=c++11 -Ilibs/webview $(pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0) -o build/basic \u0026\u0026 ./build/basic\n# macOS\ng++ basic.cc -std=c++11 -Ilibs/webview -framework WebKit -o build/basic \u0026\u0026 ./build/basic\n# Windows/MinGW\ng++ basic.cc -std=c++17 -mwindows -Ilibs/webview -Ilibs/webview2/build/native/include -Llibs/webview2/build/native/x64 -lWebView2Loader.dll -lole32 -lshell32 -lshlwapi -luser32 -o build/basic.exe \u0026\u0026 \"build/basic.exe\"\n```\n\n#### Bonus for Visual C++\n\nBuild a shared library with WebView2 linked statically:\n\n```bat\ncl libs\\webview\\webview.cc /std:c++17 /EHsc /Fobuild\\ ^\n    /D \"WEBVIEW_API=__declspec(dllexport)\" ^\n    /I libs\\webview ^\n    /I libs\\webview2\\build\\native\\include ^\n    libs\\webview2\\build\\native\\x64\\WebView2LoaderStatic.lib ^\n    /link /DLL advapi32.lib /OUT:build\\webview.dll\n```\n\nBuild the example with WebView2 linked statically:\n\n```bat\ncl basic.cc /std:c++17 /EHsc /Fobuild\\ ^\n    /I libs\\webview ^\n    /I libs\\webview2\\build\\native\\include ^\n    libs\\webview2\\build\\native\\x64\\WebView2LoaderStatic.lib ^\n    /link advapi32.lib /OUT:build\\basic.exe\n```\n\n### Getting Started with C\n\nSave the basic C example into your project directory:\n\n```sh\ncurl -sSLo basic.c \"https://raw.githubusercontent.com/webview/webview/master/examples/basic.c\"\n```\n\nBuild the library and example, then run it:\n\n```sh\n# Linux\ng++ -c libs/webview/webview.cc -std=c++11 $(pkg-config --cflags gtk+-3.0 webkit2gtk-4.0) -o build/webview.o\ngcc -c basic.c -std=c99 -Ilibs/webview -o build/basic.o\ng++ build/basic.o build/webview.o $(pkg-config --libs gtk+-3.0 webkit2gtk-4.0) -o build/basic \u0026\u0026 build/basic\n# macOS\ng++ -c libs/webview/webview.cc -std=c++11 -o build/webview.o\ngcc -c basic.c -std=c99 -Ilibs/webview -o build/basic.o\ng++ build/basic.o build/webview.o -framework WebKit -o build/basic \u0026\u0026 build/basic\n# Windows/MinGW\ng++ -c libs/webview/webview.cc -std=c++17 -Ilibs/webview2/build/native/include -o build/webview.o\ngcc -c basic.c -std=c99 -Ilibs/webview -o build/basic.o\ng++ build/basic.o build/webview.o -mwindows -Llibs/webview2/build/native/x64 -lWebView2Loader.dll -lole32 -lshell32 -lshlwapi -luser32 -o build/basic.exe \u0026\u0026 \"build/basic.exe\"\n```\n\n### Getting Started with Go\n\nSee [Go package documentation][go-docs] for the Go API documentation, or simply read the source code.\n\nCreate a new Go module:\n\n```sh\ngo mod init example.com/m\n```\n\nOn Windows you will need to make the WebView2 loader discoverable by cgo (see [Windows Preperation](#windows-preperation)):\n\n```bat\nset CGO_CXXFLAGS=\"-I%cd%\\libs\\webview2\\build\\native\\include\"\nset CGO_LDFLAGS=\"-L%cd%\\libs\\webview2\\build\\native\\x64\"\n```\n\n\u003e **Note:** Argument quoting works for Go 1.18 and later. Quotes can be removed if paths have no spaces.\n\nSave the basic Go example into your project directory:\n\n```sh\ncurl -sSLo basic.go \"https://raw.githubusercontent.com/webview/webview/master/examples/basic.go\"\n```\n\nInstall dependencies:\n\n```sh\ngo get github.com/webview/webview\n```\n\nBuild and run the example:\n\n```sh\n# Linux, macOS\ngo build -o build/basic basic.go \u0026\u0026 ./build/basic\n# Windows\ngo build -ldflags=\"-H windowsgui\" -o build/basic.exe basic.go \u0026\u0026 \"build/basic.exe\"\n```\n\n### More Examples\n\nThe examples shown here are mere pieces of a bigger picture so we encourage you to try [other examples][examples] and explore on your own—you can follow the same procedure. Please [get in touch][issues-new] if you find any issues.\n\n## App Distribution\n\nDistribution of your app is outside the scope of this library but we can give some pointers for you to explore.\n\n### macOS Application Bundle\n\nOn macOS you would typically create a bundle for your app with an icon and proper metadata.\n\nA minimalistic bundle typically has the following directory structure:\n\n```\nexample.app                 bundle\n└── Contents\n    ├── Info.plist          information property list\n    ├── MacOS\n    |   └── example         executable\n    └── Resources\n        └── example.icns    icon\n```\n\nRead more about the [structure of bundles][macos-app-bundle] at the Apple Developer site.\n\n\u003e Tip: The `png2icns` tool can create icns files from PNG files. See the `icnsutils` package for Debian-based systems.\n\n### Windows Apps\n\nYou would typically create a resource script file (`*.rc`) with information about the app as well as an icon. Since you should have MinGW-w64 readily available then you can compile the file using `windres` and link it into your program. If you instead use Visual C++ then look into the [Windows Resource Compiler][win32-rc].\n\nThe directory structure could look like this:\n\n```\nmy-project/\n├── icons/\n|   ├── application.ico\n|   └── window.ico\n├── basic.cc\n└── resources.rc\n```\n\n`resources.rc`:\n```\n100 ICON \"icons\\\\application.ico\"\n32512 ICON \"icons\\\\window.ico\"\n```\n\n\u003e **Note:** The ID of the icon resource to be used for the window must be `32512` (`IDI_APPLICATION`).\n\nCompile:\n```sh\nwindres -o build/resources.o resources.rc\ng++ basic.cc build/resources.o [...]\n```\n\nRemember to bundle the DLLs you have not linked statically, e.g. `WebView2Loader.dll` and those from MinGW-w64.\n\n## MinGW-w64 Requirements\n\nIn order to build this library using MinGW-w64 on Windows then it must support C++17 and have an up-to-date Windows SDK. This applies both when explicitly building the C/C++ library as well as when doing so implicitly through Go/cgo.\n\nDistributions that are known to be compatible:\n\n* [LLVM MinGW](https://github.com/mstorsjo/llvm-mingw)\n* [MSYS2](https://www.msys2.org/)\n* [WinLibs](https://winlibs.com/)\n\n## Development\n\nTo build the library, examples and run tests, run `script/build.sh` on Unix-based systems and `script/build.bat` on Windows.\n\n\u003e **Note:** These scripts are not in the best condition but a rewrite is being planned. Please bear with us and manually edit the scripts to your liking.\n\n## Limitations\n\n### Browser Features\n\nSince a browser engine is not a full web browser it may not support every feature you may expect from a browser. If you find that a feature does not work as expected then please consult with the browser engine's documentation and [open an issue][issues-new] if you think that the library should support it.\n\nFor example, the library does not attempt to support user interaction features like `alert()`, `confirm()` and `prompt()` and other non-essential features like `console.log()`.\n\n### Go Bindings\n\nCalling `Eval()` or `Dispatch()` before `Run()` does not work because the webview instance has only been configured and not yet started.\n\n## Bindings\n\nLanguage    | Project\n----------  | -------\nC#          | [webview/webview_csharp](https://github.com/webview/webview_csharp)\nCrystal     | [naqvis/webview](https://github.com/naqvis/webview)\nDeno        | [webview/webview_deno](https://github.com/webview/webview_deno)\nGo          | [webview/webview][webview]\nHaskell     | [lettier/webviewhs](https://github.com/lettier/webviewhs)\nJanet       | [janet-lang/webview](https://github.com/janet-lang/webview)\nJava        | [webview/webview_java](https://github.com/webview/webview_java)\nKotlin      | [Winterreisender/webviewko](https://github.com/Winterreisender/webviewko)\nNim         | [oskca/webview](https://github.com/oskca/webview)\nPascal      | [PierceNg/fpwebview](http://github.com/PierceNg/fpwebview)\nPython      | [zserge/webview-python](https://github.com/zserge/webview-python)\nRuby        | [Maaarcocr/webview_ruby](https://github.com/Maaarcocr/webview_ruby)\nRust        | [Boscop/webview-rs](https://github.com/Boscop/webview-rs)\nV           | [malisipi/mui](https://github.com/malisipi/mui/tree/main/webview)\n\nIf you wish to add bindings to the list, feel free to submit a pull request or [open an issue][issues-new].\n\n## License\n\nCode is distributed under MIT license, feel free to use it in your proprietary projects as well.\n\n[macos-app-bundle]:  https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html\n[docs-repo]:         https://github.com/webview/docs\n[examples]:          https://github.com/webview/webview/tree/master/examples\n[go-docs]:           https://pkg.go.dev/github.com/webview/webview\n[gtk]:               https://docs.gtk.org/gtk3/\n[issues]:            https://github.com/webview/docs/issues\n[issues-new]:        https://github.com/webview/webview/issues/new\n[webkit]:            https://webkit.org/\n[webkitgtk]:         https://webkitgtk.org/\n[webview]:           https://github.com/webview/webview\n[webview.dev]:       https://webview.dev\n[ms-webview2]:       https://developer.microsoft.com/en-us/microsoft-edge/webview2/\n[ms-webview2-sdk]:   https://www.nuget.org/packages/Microsoft.Web.WebView2\n[ms-webview2-rt]:    https://developer.microsoft.com/en-us/microsoft-edge/webview2/\n[win32-api]:         https://docs.microsoft.com/en-us/windows/win32/apiindex/windows-api-list\n[win32-rc]:          https://docs.microsoft.com/en-us/windows/win32/menurc/resource-compiler\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikulin%2Fwebview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikulin%2Fwebview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikulin%2Fwebview/lists"}