Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tauri Web Frontend

A flexible Tauri-based web frontend wrapper that can load any URL specified via command-line arguments. It exposes native system bindings to the loaded page via a JavaScript library.

Features

  • Load Any URL: Specify the target URL at runtime using the --url argument.
  • Native Bindings: JavaScript library provided to interact with the Rust backend.
  • Cross-Platform: Builds for Windows, macOS, and Linux.

Getting Started

Prerequisites

  • Rust (Cargo)
  • Node.js (npm/pnpm/yarn)
  • System dependencies for Tauri (see Tauri Docs)

Installation

Clone the repository and install dependencies:

git clone <repository_url>
cd tauri-web-frontend
npm install

Running the App

Run the application in development mode:

npm run tauri dev

To load a specific URL:

npm run tauri dev -- -- --url https://google.com

Note: The extra -- are needed to pass arguments through the npm script to the binary.

Building

Build the application for production:

npm run tauri build

The output binary will be in src-tauri/target/release/.

usage with Native Bindings

The application exposes native commands (like greet) to the loaded page. To use them, include the provided JavaScript library in your web project.

JavaScript Library

The bindings library is located in js-lib/. You can publish this package or include it directly in your frontend project.

JavaScript API

The web application loaded by Tauri has access to the window.__TAURI__ object, exposing the full Tauri API (if enabled).

In addition, we provide a wrapper library tauri-web-frontend-bindings with the following helper functions:

greet(name: string): Promise<string>

Sends a greeting request to the Rust backend.

  • Example: match greet('Dave') { Ok(msg) => console.log(msg) }

isTauriAvailable(): boolean

Checks if the application is running within the Tauri context.

Official API

For the complete list of available system APIs (File System, Dialog, standard Window controls, etc.), please refer to the Tauri v2 Documentation.

Configuration

The application accepts several command-line arguments to customize its behavior and appearance.

Window Management

Argument Description Example
--url <URL> The URL to load on startup. --url https://google.com
--width <pixels> Set the initial window width. --width 1024
--height <pixels> Set the initial window height. --height 768
--fullscreen Start the application in fullscreen mode. --fullscreen
--minimized Start the application minimized. --minimized
--no-resizable Disable window resizing by the user. --no-resizable
--frameless Remove the window frame and title bar. --frameless

Security & Restrictions

Argument Description Example
--allowed-domains <list> Comma-separated list of domains allowed for navigation. Navigating to other domains will be blocked. --allowed-domains google.com,github.com
--api-domains <list> Comma-separated list of domains allowed to use the native API (bindings). --api-domains myapp.com

About

A web frontend with installable packages for multiple platforms

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages