Skip to content

Commit 2dfb700

Browse files
authored
chore(sidecar): shell:allow-open permission is not required (tauri-apps#3472)
1 parent 2310ec1 commit 2dfb700

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

src/content/docs/develop/sidecar.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ You can place this code inside a Tauri command to easily pass the AppHandle or y
131131

132132
When running the sidecar, Tauri requires you to give the sidecar permission to run the `execute` or `spawn` method on the child process. To grant this permission, go to the file `<PROJECT ROOT>/src-tauri/capabilities/default.json` and add the section below to the permissions array. Don't forget to name your sidecar according to the relative path mentioned earlier.
133133

134-
```json title="src-tauri/capabilities/default.json" ins={4-13}
134+
```json title="src-tauri/capabilities/default.json" ins={4-12}
135135
{
136136
"permissions": [
137137
"core:default",
@@ -143,8 +143,7 @@ When running the sidecar, Tauri requires you to give the sidecar permission to r
143143
"sidecar": true
144144
}
145145
]
146-
},
147-
"shell:allow-open"
146+
}
148147
]
149148
}
150149
```
@@ -175,7 +174,7 @@ Arguments can be either **static** (e.g. `-o` or `serve`) or **dynamic** (e.g. `
175174

176175
First, define the arguments that need to be passed to the sidecar command in `src-tauri/capabilities/default.json`:
177176

178-
```json title="src-tauri/capabilities/default.json" ins={8-25}
177+
```json title="src-tauri/capabilities/default.json" ins={8-24}
179178
{
180179
"$schema": "../gen/schemas/desktop-schema.json",
181180
"identifier": "default",
@@ -199,8 +198,7 @@ First, define the arguments that need to be passed to the sidecar command in `sr
199198
"sidecar": true
200199
}
201200
]
202-
},
203-
"shell:allow-open"
201+
}
204202
]
205203
}
206204
```

src/content/docs/ja/develop/sidecar.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ tauri::async_runtime::spawn(async move {
135135

136136
「サイドカー」を実行する場合、Tauri では、子プロセスで `execute` または `spawn` メソッドを実行する権限を「サイドカー」に付与する必要があります。この権限を付与するには、ファイル `<PROJECT ROOT>/src-tauri/capabilities/default.json` に移動し、以下のセクションを権限配列に追加します。前述の「Note」欄で説明した「相対パスの記述方法」に従って「サイドカー」を記述することを忘れないでください。
137137

138-
```json title="src-tauri/capabilities/default.json" ins={4-13}
138+
```json title="src-tauri/capabilities/default.json" ins={4-12}
139139
{
140140
"permissions": [
141141
"core:default",
@@ -147,8 +147,7 @@ tauri::async_runtime::spawn(async move {
147147
"sidecar": true
148148
}
149149
]
150-
},
151-
"shell:allow-open"
150+
}
152151
]
153152
}
154153
```
@@ -179,7 +178,7 @@ const output = await command.execute();
179178

180179
まず、`src-tauri/capabilities/default.json` に、サイドカー・コマンドに渡す必要がある引数を定義します:
181180

182-
```json title="src-tauri/capabilities/default.json" ins={8-25}
181+
```json title="src-tauri/capabilities/default.json" ins={8-24}
183182
{
184183
"$schema": "../gen/schemas/desktop-schema.json",
185184
"identifier": "default",
@@ -203,8 +202,7 @@ const output = await command.execute();
203202
"sidecar": true
204203
}
205204
]
206-
},
207-
"shell:allow-open"
205+
}
208206
]
209207
}
210208
```

src/content/docs/zh-cn/develop/sidecar.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const output = await sidecar_command.execute();
124124

125125
首先,在 `src-tauri/capabilities/default.json` 中定义需要传递给 sidecar 命令的参数。
126126

127-
```json title="src-tauri/capabilities/default.json" ins={14-31}
127+
```json title="src-tauri/capabilities/default.json" ins={14-30}
128128
{
129129
"$schema": "../gen/schemas/desktop-schema.json",
130130
"identifier": "default",
@@ -155,8 +155,7 @@ const output = await sidecar_command.execute();
155155
"sidecar": true
156156
}
157157
]
158-
},
159-
"shell:allow-open"
158+
}
160159
]
161160
}
162161
```

0 commit comments

Comments
 (0)