fix(desktop): respect local-origin tauri shell for directory access (#391)

* feat: enable local-origin desktop features and copy in terminal support

- Enable arbitrary web loads in desktop web content for TAURI apps.
- Guard directory dialog access behind local-origin origin check.
- Add copy-to-clipboard support for terminal selections via common shortcuts.

* fix: improve initial directory resolution and persistence in directory store
This commit is contained in:
Bohdan Triapitsyn
2026-02-11 20:07:44 +02:00
committed by GitHub
parent 844562749d
commit 3afe0bb45d
7 changed files with 111 additions and 22 deletions
+1 -1
View File
@@ -1961,7 +1961,7 @@ fn build_init_script(local_origin: &str) -> String {
init_script.push_str("\ntry{var old=document.getElementById('__oc-instance-switcher');if(old)old.remove();}catch(_e){}");
if !cfg!(debug_assertions) {
init_script.push_str("\ntry{document.addEventListener('contextmenu',function(e){e.preventDefault();},true);}catch(_e){}");
init_script.push_str("\ntry{document.addEventListener('contextmenu',function(e){var t=e&&e.target;if(!t||typeof t.closest!=='function'){e.preventDefault();return;}if(t.closest('.terminal-viewport-container,[data-oc-allow-native-contextmenu],input,textarea,[contenteditable=\"true\"]')){return;}e.preventDefault();},true);}catch(_e){}");
}
init_script