{"id":13578162,"url":"https://github.com/javalikescript/webview-c","last_synced_at":"2025-04-05T16:31:56.108Z","repository":{"id":43893074,"uuid":"260852700","full_name":"javalikescript/webview-c","owner":"javalikescript","description":"A tiny cross-platform webview C library to build modern cross-platform GUIs","archived":false,"fork":false,"pushed_at":"2024-04-22T19:46:05.000Z","size":1218,"stargazers_count":62,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T15:49:26.766Z","etag":null,"topics":["c","kiosk","linux","raspberry","single-header-lib","webui","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javalikescript.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-03T07:43:09.000Z","updated_at":"2024-10-16T20:57:27.000Z","dependencies_parsed_at":"2023-11-30T21:23:15.504Z","dependency_job_id":"df0d4bc2-54a0-4117-bd1e-151980b33d8a","html_url":"https://github.com/javalikescript/webview-c","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javalikescript%2Fwebview-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javalikescript%2Fwebview-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javalikescript%2Fwebview-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javalikescript%2Fwebview-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javalikescript","download_url":"https://codeload.github.com/javalikescript/webview-c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247366354,"owners_count":20927498,"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":["c","kiosk","linux","raspberry","single-header-lib","webui","windows"],"created_at":"2024-08-01T15:01:28.046Z","updated_at":"2025-04-05T16:31:55.711Z","avatar_url":"https://github.com/javalikescript.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"## Overview\n\nA tiny cross-platform webview C library to build modern cross-platform GUIs.\n\nIt supports two-way JavaScript bindings, to call JavaScript from C and to call C from JavaScript.\n\nIt uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and MSHTML (IE10/11) or Edge (Chromium) on Windows.\n\nThis library is a fork of the [webview](https://github.com/zserge/webview/tree/9c1b0a888aa40039d501c1ea9f60b22a076a25ea) library.\nThe goal of this fork is mainly to retain the support of MinGW, the C language and the IE fallback on Windows.\n\nA [Lua binding](https://github.com/javalikescript/lua-webview) is available.\n\n## Limitations\n\nOpening multiple webviews is not supported.\n\n## Prerequisites\n\nYou need the `gcc` compiler.\n\nOn Linux you need the GTK and WebKit2GTK libraries.\n\n```bash\nsudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev\n```\n\n## Example\n\nLook at the example `webview-example.c`.\n\n```c\n#define WEBVIEW_IMPLEMENTATION\n/* don't forget to define WEBVIEW_WINAPI,WEBVIEW_GTK or WEBVIEW_COCAO */\n#include \"webview.h\"\n\nint main() {\n  /* Open Lua in a 800x600 resizable window */\n  webview_run(\"Minimal webview example\", \"https://www.lua.org\", 800, 600, 1);\n  return 0;\n}\n```\n\nBuild it using the following command line.\n\n```bash\n# Linux\ngcc webview-example.c -DWEBVIEW_GTK=1 `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o webview-example\n\n# MacOS\ngcc -ObjC -DOBJC_OLD_DISPATCH_PROTOTYPES=1 webview-example.c -DWEBVIEW_COCOA=1 -framework WebKit -o webview-example\n\n# Windows (MinGW)\ngcc webview-example.c -DWEBVIEW_WINAPI=1 -Ims.webview2/include -lole32 -lcomctl32 -loleaut32 -luuid -lgdi32 -o webview-example.exe -w\n```\n\n## Edge\n\nThe Edge (Chromium) implementation requires the extra library `WebView2Loader.dll`\npart of the [Microsoft Edge WebView2](https://docs.microsoft.com/en-gb/microsoft-edge/hosting/webview2) SDK.\nThe environment variable `WEBVIEW2_WIN32_PATH` can be used to pass the folder containing the extra library.\n\nThe [WebView2 Runtime](https://docs.microsoft.com/en-gb/microsoft-edge/webview2/concepts/distribution#understanding-the-webview2-runtime) shall be installed with the same architecture, x64 or x86. The Evergreen WebView2 Runtime is included as part of the Windows 11 operating system.\n\nThe WebView2 SDK may fail to auto detect the WebView2 Runtime installation path to use,\nyou could indicate the correct installation path by using the environment variable `WEBVIEW2_BROWSER_EXECUTABLE_FOLDER`.\n\n[_The Microsoft Edge Stable channel is unavailable for WebView2 usage to prevent apps from taking a dependency on the browser in production._](https://docs.microsoft.com/en-gb/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-0.9.622#createcorewebview2environmentwithoptions)\nIf you still want to use an Microsoft Edge Stable channel for WebView2 you may create a symbolic link named `Edge-Application` using the following command as administrator.\n\n```cmd\ncd \"\\Program Files (x86)\\Microsoft\"\nmklink /D Edge-Application Edge\\Application\n```\n\nNote that this implementation creates a folder for the user data,\nyou could specify a user data folder by using the environment variable `WEBVIEW2_USER_DATA_FOLDER`.\n\n## WebKitGTK\n\nThe WebKitGTK implementation is sensitive to the environment variables.\nStarting a webview from a VS Code terminal may require to disable environment variables inheritance.\n\n```bash\nfor name in `env | grep _VSCODE_SNAP_ORIG | sed 's/_VSCODE_SNAP_ORIG.*$//'`; do fullname=${name}_VSCODE_SNAP_ORIG; test -z \"${!fullname}\" \u0026\u0026 unset ${name} || export ${name}=${!fullname}; unset ${fullname}; done\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavalikescript%2Fwebview-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavalikescript%2Fwebview-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavalikescript%2Fwebview-c/lists"}