webview_deno
deno bindings for webview using the webview_rust library.
Webview is a tiny cross-platform library to render web-based GUIs for desktop applications.
⚠️ This project is still in an development. Expect breaking changes.
Example
import { Webview } from "https://deno.land/x/webview/mod.ts";
const html = `
<html>
<body>
<h1>Hello from deno v${Deno.version.deno}</h1>
</body>
</html>
`;
const webview = new Webview();
webview.navigate(`data:text/html,${encodeURIComponent(html)}`);
webview.run();
You can run this example directly from the web:
deno run -Ar --unstable https://deno.land/x/webview/examples/local.ts
or in your development environment:
deno run -Ar --unstable examples/local.ts
you can find other examples in the examples/
directory.
Documentation
You can find the official documentation here.
Development
Prerequisites
Linux
- webkit2gtk (to install using apt:
sudo apt-get install libwebkit2gtk-4.0-dev
)
Building
Building on Windows requires admin privileges.
make build
# OR cargo build
Running
To run webview_deno without automatically downloading the binaries from
releases you will need to
use the environment variable PLUGIN_URL
and set it to the path where the built
binaries are located. This is usually file://./target/release
.
$ make build
$ PLUGIN_URL=target/debug/
$ deno run --unstable -A examples/local.ts
Environment variables
PLUGIN_URL
- Set a custom library URL. Defaults to the latest release assets on Github. Setting this also disables cache forplug
.
Dependencies
Other
Contribution
Pull request, issues and feedback are very welcome. Code style is formatted with
make fmt
(which internally runs deno fmt
and cargo fmt
) and commit
messages are done following
Conventional Commits spec.
Licence
Copyright 2020-2022, the webview_deno team. All rights reserved. MIT license.