{"id":16092251,"url":"https://github.com/webviewjs/webview","last_synced_at":"2025-03-18T06:30:54.880Z","repository":{"id":257816560,"uuid":"864491141","full_name":"webviewjs/webview","owner":"webviewjs","description":"Robust cross-platform webview library for Node/Deno/Bun","archived":false,"fork":false,"pushed_at":"2024-12-16T04:06:07.000Z","size":2098,"stargazers_count":20,"open_issues_count":9,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-14T22:06:39.378Z","etag":null,"topics":["binding","bun","deno","executable","hacktoberfest","javascript","napi","node","rust","tao","webview","wry"],"latest_commit_sha":null,"homepage":"https://npm.im/@webviewjs/webview","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webviewjs.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":"2024-09-28T11:07:34.000Z","updated_at":"2025-03-14T15:41:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf5dea1f-4360-45cc-b538-bd6324a752ef","html_url":"https://github.com/webviewjs/webview","commit_stats":null,"previous_names":["webviewjs/webview"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webviewjs%2Fwebview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webviewjs%2Fwebview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webviewjs%2Fwebview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webviewjs%2Fwebview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webviewjs","download_url":"https://codeload.github.com/webviewjs/webview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243652705,"owners_count":20325610,"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":["binding","bun","deno","executable","hacktoberfest","javascript","napi","node","rust","tao","webview","wry"],"created_at":"2024-10-09T16:06:14.881Z","updated_at":"2025-03-18T06:30:54.874Z","avatar_url":"https://github.com/webviewjs.png","language":"Rust","readme":"# `@webviewjs/webview`\n\n![https://github.com/webviewjs/webview/actions](https://github.com/webviewjs/webview/workflows/CI/badge.svg)\n\nRobust cross-platform webview library for Node.js written in Rust. It is a native binding to [tao](https://github.com/tauri-apps/tao) and [wry](https://github.com/tauri-apps/wry) allowing you to easily manage cross platform windowing and webview.\n\n![preview](https://github.com/webviewjs/webview/raw/main/assets/preview.png)\n\n\u003e [!CAUTION]\n\u003e This library is still in development and not ready for production use. Feel free to experiment with it and report any issues you find.\n\n# Installation\n\n```bash\nnpm install @webviewjs/webview\n```\n\n# Supported platforms\n\n| Platform                | Supported |\n| ----------------------- | --------- |\n| x86_64-apple-darwin     | ✅        |\n| x86_64-pc-windows-msvc  | ✅        |\n| i686-pc-windows-msvc    | ✅        |\n| aarch64-apple-darwin    | ✅        |\n| aarch64-linux-android   | ✅        |\n| armv7-linux-androideabi | ✅        |\n| aarch64-pc-windows-msvc | ✅        |\n\n# Examples\n\n## Load external url\n\n```js\nimport { Application } from '@webviewjs/webview';\n// or\nconst { Application } = require('@webviewjs/webview');\n\nconst app = new Application();\nconst window = app.createBrowserWindow();\nconst webview = window.createWebview();\n\nwebview.loadUrl('https://nodejs.org');\n\napp.run();\n```\n\n## IPC\n\n```js\nconst app = new Application();\nconst window = app.createBrowserWindow();\n\nconst webview = window.createWebview({\n    html: `\u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n        \u003chead\u003e\n            \u003ctitle\u003eWebview\u003c/title\u003e\n        \u003c/head\u003e\n        \u003cbody\u003e\n            \u003ch1 id=\"output\"\u003eHello world!\u003c/h1\u003e\n            \u003cbutton id=\"btn\"\u003eClick me!\u003c/button\u003e\n            \u003cscript\u003e\n                btn.onclick = function send() {\n                    window.ipc.postMessage('Hello from webview');\n                }\n            \u003c/script\u003e\n        \u003c/body\u003e\n    \u003c/html\u003e\n    `,\n    preload: `window.onIpcMessage = function(data) {\n        const output = document.getElementById('output');\n        output.innerText = \\`Server Sent A Message: \\${data}\\`;\n    }`\n});\n\nif (!webview.isDevtoolsOpen()) webview.openDevtools();\n\nwebview.onIpcMessage((data) =\u003e {\n    const reply = `You sent ${data.body.toString('utf-8')}`;\n    window.evaluateScript(`onIpcMessage(\"${reply}\")`)\n})\n\napp.run();\n```\n\nCheck out [examples](./examples) directory for more examples, such as serving contents from a web server to webview, etc.\n\n# Building executables\n\n\u003e [!WARNING]\n\u003e The CLI feature is very experimental and may not work as expected. Please report any issues you find.\n\nYou can use [Single Executable Applications](https://nodejs.org/api/single-executable-applications.html) feature of Node.js to build an executable file. WebviewJS comes with a helper cli script to make this process easier.\n\n```bash\nwebview --build --input ./path/to/your/script.js --output ./path/to/output-directory --name my-app\n```\n\nYou can pass `--resources ./my-resource.json` to include additional resources in the executable. This resource can be imported using `getAsset()` or `getRawAsset()` functions from `node:sea` module.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebviewjs%2Fwebview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebviewjs%2Fwebview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebviewjs%2Fwebview/lists"}