Skip to main content

Lockdown

易用性
拓展性
性能
安全性
优点
  • Highest 安全 rating
  • Elegant and powerful
缺点
  • Rust skills required
  • No remote resources

说明#

The Lockdown recipe is a minimal usage of the Bridge pattern, which only allows interaction between Rust and the Window via expiring JS Promise Closures that are injected into the Window by Rust and nulled as part of the callback.

示意图#

graph TD H==>F G-.->B B-->G subgraph WEBVIEW G-->F end subgraph RUST A-->B A==>H end A[Binary] B[API:Event] F[Window] G((Promise Closure)) H{Bootstrap} style RUST fill:#fad3a9,stroke:#F28918,stroke-width:4px style WEBVIEW fill:#abd0f9,stroke:#1D81EE,stroke-width:4px

配置#

这是你需要在你的 tauri.conf.json 中添加的配置:

"tauri": {
  "allowlist": {}                  // all API endpoints are default false
}