• Stars
    star
    3,156
  • Rank 13,663 (Top 0.3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross-platform WebView library in Rust for Tauri.

WRY Webview Rendering library

License Chat Server website https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg support

Cross-platform WebView rendering library in Rust that supports all major desktop platforms like Windows, macOS, and Linux.

Overview

WRY connects the web engine on each platform and provides easy to use and unified interface to render WebView. It also re-exports TAO as a module for event loop and window creation.

Usage

The minimum example to create a Window and browse a website looks like following:

fn main() -> wry::Result<()> {
  use wry::{
    application::{
      event::{Event, StartCause, WindowEvent},
      event_loop::{ControlFlow, EventLoop},
      window::WindowBuilder,
    },
    webview::WebViewBuilder,
  };

  let event_loop = EventLoop::new();
  let window = WindowBuilder::new()
    .with_title("Hello World")
    .build(&event_loop)?;
  let _webview = WebViewBuilder::new(window)?
    .with_url("https://tauri.studio")?
    .build()?;

  event_loop.run(move |event, _, control_flow| {
    *control_flow = ControlFlow::Wait;

    match event {
      Event::NewEvents(StartCause::Init) => println!("Wry has started!"),
      Event::WindowEvent {
        event: WindowEvent::CloseRequested,
        ..
      } => *control_flow = ControlFlow::Exit,
      _ => (),
    }
  });
}

There are also more samples under examples, you can enter commands like the following to try them:

cargo run --example multi_window

For more information, please read the documentation below.

Documentation

Platform-specific notes

All platforms use TAO to build the window, and wry re-exports it as an application module. Here is the underlying web engine each platform uses, and some dependencies you might need to install.

Linux

Tao uses gtk-rs and its related libraries for window creation and wry also needs WebKitGTK for WebView. So please make sure the following packages are installed:

Arch Linux / Manjaro:

sudo pacman -S webkit2gtk-4.1
sudo pacman -S libappindicator-gtk3 # For tray feature

The libayatana-indicator package can be installed from the Arch User Repository (AUR).

Debian / Ubuntu:

sudo apt install libwebkit2gtk-4.1-dev
# For tray feature, choose one of following package
sudo apt install libayatana-appindicator3-dev
sudo apt install libappindicator3-dev

Fedora

sudo dnf install gtk3-devel webkit2gtk4.1-devel
# For tray feature
sudo dnf install libappindicator-gtk3-devel

Fedora does not have the Ayatana package yet, so you need to use the GTK one, see the feature flags documentation.

macOS

WebKit is native on macOS so everything should be fine.

If you are cross-compiling for macOS using osxcross and encounter a runtime panic like Class with name WKWebViewConfiguration could not be found it's possible that WebKit.framework has not been linked correctly, to fix this set the RUSTFLAGS environment variable:

RUSTFLAGS="-l framework=WebKit" cargo build --target=x86_64-apple-darwin --release

Windows

WebView2 provided by Microsoft Edge Chromium is used. So wry supports Windows 7, 8, 10 and 11.

Android / iOS

Wry supports mobile with the help of tauri-mobile CLI to create template project. If you are interested in playing or hacking it, please follow MOBILE.md.

If you wish to create Android project yourself, there are a few kotlin files that are needed to run wry on Android and you have to set the following environment variables:

  • WRY_ANDROID_PACKAGE which is the reversed domain name of your android project and the app name in snake_case for example: com.wry.example.wry_app
  • WRY_ANDROID_LIBRARY for example: if your cargo project has a lib name wry_app, it will generate libwry_app.so so you se this env var to wry_app
  • WRY_ANDROID_KOTLIN_FILES_OUT_DIR for example: path/to/app/src/main/kotlin/com/wry/example

License

Apache-2.0/MIT

More Repositories

1

tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
Rust
75,955
star
2

awesome-tauri

πŸš€ Awesome Tauri Apps, Plugins and Resources
3,470
star
3

cargo-mobile2

Rust on mobile made easy!
Rust
1,385
star
4

tao

The TAO of cross-platform windowing. A library in Rust built for Tauri.
Rust
1,364
star
5

create-tauri-app

Rapidly scaffold out a new tauri app project.
Rust
855
star
6

tauri-docs

The source for all Tauri project documentation.
MDX
701
star
7

tauri-action

Build your Web application as a Tauri binary for macOS, Linux and Windows
TypeScript
679
star
8

plugins-workspace

All of the official Tauri plugins in one place!
Rust
586
star
9

window-vibrancy

Make your windows vibrant.
Rust
506
star
10

tauri-vscode

Visual Studio Code Extension for Tauri apps development
TypeScript
420
star
11

vue-cli-plugin-tauri

Turn your Vue SPA into a lightweight cross-platform desktop app
JavaScript
374
star
12

tauri-plugin-sql

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
322
star
13

tauri-egui

Rust
315
star
14

tauri-plugin-store

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
249
star
15

muda

Menu Utilities for Desktop Applications in Rust.
Rust
158
star
16

window-shadows

Add native shadows to your windows.
Rust
154
star
17

tray-icon

Tray icons for Desktop Applications.
Rust
140
star
18

webkit2gtk-rs

WebKit2 bindings and wrappers for Rust
Rust
125
star
19

tauri-bindgen

Typesafe language bindings generator for the Tauri IPC bridge
Rust
122
star
20

tauri-plugin-window-state

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
112
star
21

tauri-plugin-log

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
98
star
22

global-hotkey

Global hotkeys for Desktop Applications.
Rust
91
star
23

javascriptcore-rs

JavaScriptCore bindings and wrappers for Rust
Rust
84
star
24

tauri-plugin-positioner

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
79
star
25

tauri-plugin-stronghold

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
77
star
26

tauri-plugin-authenticator

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
74
star
27

smoke-tests

A collection of frameworks used as a suite of smoke-tests for tauri
JavaScript
73
star
28

tauri-plugin-autostart

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
59
star
29

tauri-plugin-localhost

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
56
star
30

tauri-plugin-fs-watch

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
56
star
31

meilisearch-docsearch

A quick search component for meilisearch, inspired by algolia/docsearch.
TypeScript
54
star
32

tauri-plugin-websocket

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
53
star
33

tauri-invoke-http

A custom invoke system for Tauri that leverages a localhost server
Rust
43
star
34

libappindicator-rs

Rust safe bindings for the libappindicator library
Rust
41
star
35

tauri-theia

Tauri Flavor of Theia
Rust
39
star
36

tauri-plugin-fs-extra

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
TypeScript
39
star
37

fix-path-env-rs

Rust
32
star
38

tauricon

Make icons for your tauri app with nodejs
TypeScript
29
star
39

tauri-plugin-single-instance

[DEPRECATED] Please use the plugin from https://github.com/tauri-apps/plugins-workspace instead.
Rust
24
star
40

tauri-plugin-upload

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
24
star
41

tauri-forage

Currified localForage with a side of extras.
TypeScript
18
star
42

tauri-hotkey-rs

Rust
17
star
43

rfcs

Request For Comments for the Tauri project
17
star
44

tauri-discord-bot

Tauri's Discord Bot
TypeScript
16
star
45

win7-notifications

Send Windows 10 styled notifications on Windows 7.
Rust
15
star
46

nsis-tauri-utils

A collection of NSIS plugins written in rust.
Rust
10
star
47

benchmark_results

10
star
48

tauri-github-bot

A GitHub bot for tauri-apps org to automate various tasks and intended to used only by tauri-apps org members.
TypeScript
9
star
49

gipfs

Git ops with IPFS
8
star
50

binary-releases

Prebuilt binaries for Tauri projects
8
star
51

governance-and-guidance

Rust
7
star
52

tauri-plugin-notification

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
7
star
53

tauri-search

[Archived] Tauri's Search Capabilities for Website leveraging MeiliSearch
TypeScript
6
star
54

tauri.studio

Source code and build for the front-facing project website.
Vue
6
star
55

realworld

Realworld apps made with Tauri: Proof of Agnosis.
JavaScript
6
star
56

.github

Holds org-wide configuration files.
6
star
57

meetings

6
star
58

wry-mobile

Rust
6
star
59

tauri-includedir

Rust
5
star
60

tauri-plugin-clipboard-manager

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
5
star
61

docusaurus-meilisearch-indexer

JavaScript
5
star
62

tauri-plugin-fs

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
5
star
63

tauri-plugin-persisted-scope

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
5
star
64

tauri-plugin-process

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
4
star
65

tauri-plugin-shell

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
4
star
66

rustdocusaurus

POCβ€”turning rustdoc generated docs into Docusaurus (MD + sidebar)
JavaScript
4
star
67

dns-automation

This repo will manage DNS records automagically. Implementing Infrastructure as Code & GitOps practices.
HCL
4
star
68

tauri-plugin-os

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
4
star
69

tauri-plugin-http

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
4
star
70

tauri-plugin-global-shortcut

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
4
star
71

tauri-plugin-updater

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
4
star
72

tauri-webpack

[Deprecated] webpack for no server
JavaScript
3
star
73

typedocusaurus

TypeScript
3
star
74

tauri-plugin-cli

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
3
star
75

tauri-plugin-dialog

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
2
star
76

soup2-rs

Rust
1
star
77

benchmark_electron

Rust
1
star
78

automation

GitHub Actions available to the tauri-apps organization
JavaScript
1
star
79

tauri-inliner-rs

Rust
1
star
80

tauri-plugin-window

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
TypeScript
1
star
81

gir-files

Shell
1
star
82

msedgedriver-manifest-cache

A caching service (in the form of a static site) of the msedgedriver version manifest file that seems to go missing a lot.
Rust
1
star
83

workflow-testbed

Test bed that will soon be deleted.
1
star
84

tauri-plugin-app

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
1
star
85

tauri-dialog-rs

C
1
star