| use serde::{Deserialize, Serialize};
|
| use tauri::{AppHandle, Emitter};
|
|
|
| #[derive(Debug, Clone, Serialize, Deserialize)]
|
| #[serde(rename_all = "camelCase")]
|
| pub struct ContextMenuInfo {
|
| pub x: f64,
|
| pub y: f64,
|
| pub client_x: f64,
|
| pub client_y: f64,
|
| pub tag_name: Option<String>,
|
| pub src: Option<String>,
|
| pub href: Option<String>,
|
| pub text: Option<String>,
|
| pub page_url: Option<String>,
|
| }
|
|
|
|
|
|
|
| #[tauri::command]
|
| pub fn browser_context_menu(app: AppHandle, info: ContextMenuInfo) -> Result<(), String> {
|
| app.emit("browser://context-menu", info).map_err(|e| e.to_string())
|
| }
|
|
|