Fix devtools console copy
This commit is contained in:
parent
9523e65826
commit
8372aa28f6
2 changed files with 18 additions and 3 deletions
|
|
@ -2,6 +2,9 @@
|
||||||
"$schema": "../gen/schemas/desktop-schema.json",
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
"identifier": "default",
|
"identifier": "default",
|
||||||
"description": "Default capability for the Quintodrome desktop window",
|
"description": "Default capability for the Quintodrome desktop window",
|
||||||
"windows": ["main", "content"],
|
"windows": ["main"],
|
||||||
"permissions": ["core:default", "core:event:default", "shell:allow-open"]
|
"permissions": ["core:default", "core:event:default", "shell:allow-open"],
|
||||||
|
"remote": {
|
||||||
|
"urls": ["http://127.0.0.1:4533", "http://localhost:4533"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,11 @@ fn read_clipboard(app: tauri::AppHandle) -> Result<String, String> {
|
||||||
app.clipboard().read_text().map_err(|e| e.to_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.
|
/// Enables two-finger swipe-to-navigate (back/forward) in the content webview.
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
fn enable_swipe_navigation(app: &tauri::AppHandle) {
|
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.
|
// all), so Cmd+X/C/V/A/Z work in the webview's text fields.
|
||||||
.menu(|handle| tauri::menu::Menu::default(handle))
|
.menu(|handle| tauri::menu::Menu::default(handle))
|
||||||
.manage(ServerState::default())
|
.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| {
|
.setup(|app| {
|
||||||
let handle = app.handle().clone();
|
let handle = app.handle().clone();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue