|
@@ -5,7 +5,7 @@
|
|
/**
|
|
/**
|
|
* Invoke your custom commands.
|
|
* Invoke your custom commands.
|
|
*
|
|
*
|
|
- * This package is also accessible with `window.__TAURI__.tauri` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
|
|
|
|
|
+ * This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
|
* @module
|
|
* @module
|
|
*/
|
|
*/
|
|
|
|
|
|
@@ -92,11 +92,11 @@ async function invoke<T>(cmd: string, args: InvokeArgs = {}): Promise<T> {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Convert a device file path to an URL that can be loaded by the webview.
|
|
* Convert a device file path to an URL that can be loaded by the webview.
|
|
- * Note that `asset:` and `https://asset.localhost` must be allowed on the `csp` value configured on `tauri.conf.json > tauri > security`.
|
|
|
|
|
|
+ * Note that `asset:` and `https://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`.
|
|
* Example CSP value: `"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost"` to use the asset protocol on image sources.
|
|
* Example CSP value: `"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost"` to use the asset protocol on image sources.
|
|
*
|
|
*
|
|
- * Additionally, the `asset` must be allowlisted under `tauri.conf.json > tauri > allowlist > protocol`,
|
|
|
|
- * and its access scope must be defined on the `assetScope` array on the same `protocol` object.
|
|
|
|
|
|
+ * 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.
|
|
*
|
|
*
|
|
* @param filePath The file path.
|
|
* @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.
|
|
* @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.
|