Fix devtools console copy

This commit is contained in:
Philip Peterson 2026-08-25 04:03:31 -08:00
parent 9523e65826
commit 8372aa28f6
2 changed files with 18 additions and 3 deletions

View file

@ -2,6 +2,9 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Default capability for the Quintodrome desktop window",
"windows": ["main", "content"],
"permissions": ["core:default", "core:event:default", "shell:allow-open"]
"windows": ["main"],
"permissions": ["core:default", "core:event:default", "shell:allow-open"],
"remote": {
"urls": ["http://127.0.0.1:4533", "http://localhost:4533"]
}
}

View file

@ -107,6 +107,11 @@ fn read_clipboard(app: tauri::AppHandle) -> Result<String, String> {
app.clipboard().read_text().map_err(|e| e.to_string())
}
#[tauri::command]
fn write_clipboard(app: tauri::AppHandle, text: String) -> Result<(), String> {
app.clipboard().write_text(text).map_err(|e| e.to_string())
}
/// Enables two-finger swipe-to-navigate (back/forward) in the content webview.
#[cfg(target_os = "macos")]
fn enable_swipe_navigation(app: &tauri::AppHandle) {
@ -186,7 +191,14 @@ pub fn run() {
// all), so Cmd+X/C/V/A/Z work in the webview's text fields.
.menu(|handle| tauri::menu::Menu::default(handle))
.manage(ServerState::default())
.invoke_handler(tauri::generate_handler![back, forward, reload, navigate, read_clipboard])
.invoke_handler(tauri::generate_handler![
back,
forward,
reload,
navigate,
read_clipboard,
write_clipboard
])
.setup(|app| {
let handle = app.handle().clone();