1 unstable release
Uses new Rust 2024
new 0.1.1 | Apr 2, 2025 |
---|
#11 in #webview2
31 downloads per month
Used in 23 crates
(3 directly)
2.5MB
22K
SLoC
Aloe WebBrowser
Aloe WebBrowser is a flexible and extensible Rust crate designed to embed a web browsing component within applications across multiple platforms. By leveraging platform-specific web technologies, it provides an abstraction over diverse underlying web engines such as WebKit on Mac, iOS, and Linux, and options between Internet Explorer and Microsoft WebView2 on Windows.
Features
- Cross-Platform Web Engine Support: Supports WebKit on macOS, Linux, and iOS, and options for either IE or WebView2 on Windows platforms with a conditional compilation feature,
ALOE_USE_WIN_WEBVIEW2
. - Event Hooking: Implements a robust interface allowing hooking into various web events, such as page loading, network errors, and window interactions.
- Command-Driven Control: Provides a command-driven interface for fine-grained control over navigation and browser operations.
Usage
To embed a browser using aloe-webbrowser
, you first need to initialize the WebBrowserComponent
, optionally specifying unload behavior when the browser is hidden:
let browser = WebBrowserComponent::new(Some(true));
You can navigate to URLs using:
browser.go_tourl(&String::from("https://www.example.com"), None, None);
Handling Events
Implement the PageAboutToLoad
, PageFinishedLoading
, PageLoadHadNetworkError
, and other traits to respond to browser events as needed:
impl PageAboutToLoad for MyWebApp {
fn page_about_to_load(&mut self, new_url: &String) -> bool {
println!("Navigating to: {}", new_url);
true // Return whether to proceed with loading
}
}
Requirements
- Linux: Requires GTK and WebKit2GTK packages.
- Windows: WebView2 requires the presence of WebView2Loader.dll and Microsoft Edge (version 82.0.488.0 or higher).
Installation
Add the following to your Cargo.toml
:
[dependencies]
aloe-webbrowser = "0.1.0"
License
Licensed under GPL-3.0.
Note: This README.md was generated by an AI model and may not be 100% accurate. However, it should provide a solid overview of your crate.
This crate is a translation of the JUCE module.
JUCE is a c++ software framework for developing high performance audio applications.
Usage falls under the GPLv3 as well as the JUCE commercial license.
See github.com/juce-framework/JUCE and the JUCE license page for details.
This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.
Dependencies
~29–38MB
~621K SLoC