https://github.com/longbridge/wef
Wef is a Rust library for embedding WebView functionality using Chromium Embedded Framework (CEF3) with offscreen rendering support.
https://github.com/longbridge/wef
cef chrome-embedded-framework gpui webview
Last synced: 4 months ago
JSON representation
Wef is a Rust library for embedding WebView functionality using Chromium Embedded Framework (CEF3) with offscreen rendering support.
- Host: GitHub
- URL: https://github.com/longbridge/wef
- Owner: longbridge
- License: other
- Created: 2025-09-29T02:32:22.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T14:40:30.000Z (9 months ago)
- Last Synced: 2025-10-10T14:50:37.041Z (8 months ago)
- Topics: cef, chrome-embedded-framework, gpui, webview
- Language: Rust
- Homepage:
- Size: 116 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wef
> Web Embedding Framework
> [!WARNING]
> This is an experimental project, we was tried to build a offscreen rendering WebView for solve GPUI render level issues in game engine, but there still not good enough.
>
> For example, the app size (included a CEF Framework increase 1GB), development experience, etc.
>
> So, we are still use [Wry](https://github.com/longbridge/gpui-component/blob/main/crates/ui/src/webview.rs) in [Longbridge](https://longbridge.com/desktop) desktop app for now.

[](https://crates.io/crates/wef)
[](https://docs.rs/wef)
**Wef** (Web Embedding Framework) is a Rust library for embedding WebView functionality using Chromium Embedded Framework (CEF3) with offscreen rendering support.
> The `Wef` name is an abbreviation of "Web Embedding Framework", and it's also inspired by Wry.

## Features
- **Cross-Platform**: Support for Windows, macOS, and Linux
- **CEF3 Integration**: Built on top of Chromium Embedded Framework for reliable web rendering
- **Offscreen Rendering**: Advanced rendering capabilities with offscreen support
- **JavaScript Bridge**: Seamless communication between Rust and JavaScript
- **Multi-Process Architecture**: Leverages CEF's multi-process design for stability
- **Cargo Integration**: Complete toolchain with `cargo-wef` for easy development
## Quick Start
### Installation
Add `wef` to your `Cargo.toml`:
```toml
[dependencies]
wef = "0.6.0"
```
### Install cargo-wef
```bash
cargo install cargo-wef
```
### Initialize CEF
```bash
cargo wef init
```
### Basic Usage
```rust
use wef::Settings;
fn main() {
let settings = Settings::new();
wef::launch(settings, || {
// Your application logic here
});
}
```
## Development
### Building
```bash
# Build the library
cargo wef build
# Run tests
cargo test --all
# Run an example
cargo wef run -p wef-winit
```
### Requirements
- CEF binary distribution (automatically downloaded by `cargo-wef`)
- Platform-specific dependencies:
- **Linux**: `libglib2.0-dev`, `pkg-config`
- **Windows**: Visual Studio Build Tools
- **macOS**: Xcode Command Line Tools
## Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
## License
Licensed under the Apache License, Version 2.0. See [LICENSE-APACHE](LICENSE-APACHE) for details.