amtkstat/src-tauri/src/main.rs
Tony Bark 80210156bb New launch browser component
- Now possible to click links that launch the browser from the backend
- Version scheme change to account for different methods with desktop applications
2024-09-19 00:18:24 -04:00

15 lines
495 B
Rust

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use webbrowser;
#[tauri::command]
fn open_browser(address: &str) {
webbrowser::open(address).expect("Failed to open defualt browser.");
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![open_browser])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}