- I started working on this project because because
gstreamer
is broken fortauri
onsteamos
butchrome
,firefox
and other prebuilt browser work fine. - currently only supports linux
A lightweight framework for running web apps on the desktop.
lite searches for then uses already installed chromium/firefox browsers, creates a new profile specific the the web app and launches your web app with a websocket server for lite specific features such as executing commands.
Install the package:
npm install nanofuxion/lite
The package exposes 3 commands - lite --dev
, lite
and lite-build
.
lite
will serve the static assets and open the browser exactly as the compiled app would run.
lite --dev
will start the development server specified in the config.
lite-build
will build an AppImage of your web app.
lite requires a lite.config.json
file at the root of the project.
See config schema for details.
A sample config is shown below:
{
"name": "myapp",
"app": {
"devServer": "npm run my_framework_dev_server",
"devUri": "http://localhost:3000",
"dist": "dist",
"icon": "./assets/icons/32.png",
"buildCommand": "yarn build"
},
"browser": {
"name": "firefox"
},
"cmds": {
"bins": [
"steam"
]
}
}
The lite package exports a sendCmd
function that allows sending commands to the running lite app over a WebSocket connection.
First, import the sendCmd
function:
const { sendCmd } = require('lite');
Then call sendCmd with the command to execute:
sendCmd('my-command');
This will send the command over the WebSocket connection to lite.
The API has built-in reconnection logic. If the WebSocket connection is lost, it will attempt to reconnect every 5 seconds.
Coming soon*
Add linuxdeploy app image scriptwrite browser finder to find a compatible chromium/Firefox based browser to launch from.- Add support for
macOS
andwindows
via Os specific browser finder scripts.
MIT