Skip to content

Commit

Permalink
docs: added example of tauri.allowlist.protocol (#9726)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelxmoreno committed May 9, 2024
1 parent 6bb721c commit f1b0b00
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tooling/api/src/tauri.ts
Expand Up @@ -106,6 +106,19 @@ async function invoke<T>(cmd: string, args: InvokeArgs = {}): Promise<T> {
*
* Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol)
* in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object.
* For example:
* ```json
* {
* "tauri": {
* "allowlist": {
* "protocol": {
* "asset": true,
* "assetScope": ["$APPDATA/assets/*"]
* }
* }
* }
* }
* ```
*
* @param filePath The file path.
* @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.
Expand Down

0 comments on commit f1b0b00

Please sign in to comment.