Library for creating native app for all platforms with JavaScript, HTML and CSS environment. This package is nodejs wrap of the wry library.
x86_64
(works with arm)x86_64
and arm_64
(m1)x86_64
and arm_64
focus
- focus the window and webviewclose
- close the windoweval
- eval javascript in webviewtitle
- title of windowtransparent
- window with transparent backgroundwindowIcon
- icon of window (only Window and Linux)resizable
- allow user to resizeinnerSize
- set sizeminInnerSize
- set minimum sizemaxInnerSize
- set maximum sizeouterPosition
- set position of windowalwaysOnTop
- window always on topdecorations
- turn on/off decorations (window border)fullscreen
- set fullscreenmaximized
- maximize the windowminimized
- minimize the windowfiles
- handle files from file systemimport { resolve } from "path";
import OpenWebView from "native-webview";
const wv = await OpenWebView({
title: "Hello title",
innerSize: { width: 640, height: 420 },
getPath: src => resolve(__dirname, src),
onMessage: message => console.log("Message from WebView:", message)
});
$ npm run example -- examples/features.ts
$ npm run example -- examples/transparent.ts
Just double click 😉.
Dynamic change window icon is not supported. You can easily use icon with creation *.app file.
Native WebView uses WebKitGTK for WebView. So please make sure following packages are installed for development:
sudo pacman -S webkit2gtk libappindicator-gtk3
sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev
sudo dnf install gtk3-devel webkit2gtk3-devel libappindicator-gtk3-devel