https://github.com/dreaming-codes/tauri-plugin-custom-tabs-manager
https://github.com/dreaming-codes/tauri-plugin-custom-tabs-manager
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dreaming-codes/tauri-plugin-custom-tabs-manager
- Owner: Dreaming-Codes
- License: mit
- Created: 2023-07-01T03:55:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-25T17:48:30.000Z (11 months ago)
- Last Synced: 2025-01-30T10:11:14.574Z (4 months ago)
- Language: Rust
- Size: 2.51 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tauri Plugin – Custom Tabs Manager
This Tauri plugin allows the spawning of a Custom Tab. At the moment, the plugin exclusively supports Android. Support for iOS is planned, but currently not available. Desktop support is not available. I aim to introduce more advanced features, such as custom tab customization and interaction, in future releases.
My example application code can be found in the directory ./examples/tauri-app.### Example Code in Rust
Here's a brief demonstration of how one can spawn a simple custom tab using our Tauri plugin:
```rust
#[tauri::command]
fn open_custom_tab_simple(app_handle: tauri::AppHandle, url: &str) {
app_handle.custom_tabs_manager().open_custom_tab_simple(OpenCustomTabSimpleRequest {
url: url.to_string(),
try_native_app: true,
}).expect("error while opening custom tab")
}#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_custom_tabs_manager::init())
.invoke_handler(tauri::generate_handler![open_custom_tab_simple])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
### Including into your project
As of now, my plugin is not published on https://crates.io/ however the plugin can be used in your app by importing it from GitHub putting this into your Cargo.toml:
```toml
tauri-plugin-custom-tabs-manager = { git = "https://github.com/Dreaming-Codes/tauri-plugin-custom-tabs-manager"}
```https://github.com/Dreaming-Codes/tauri-plugin-custom-tabs-manager/assets/10401566/28e1248b-434a-4ce7-bfc1-37847bd18b77