Tauri shell

2024-02-05 15:25 更新

访问系统 shell。 允许您生成子进程并使用其默认应用程序管理文件和 URL。

当 build.withGlobalTauri in 设置为 时,也可以访问此包。window.__TAURI__.shelltauri.conf.jsontrue

这些 API 必须添加到 tauri.allowlist.shell 中:tauri.conf.json

{
"tauri": {
"allowlist": {
"shell": {
"all": true, // enable all shell APIs
"execute": true, // enable process spawn APIs
"sidecar": true, // enable spawning sidecars
"open": true // enable opening files/URLs using the default program
}
}
}
}

建议仅将用于优化捆绑包大小和安全性的 API 列入允许列表。


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号