tauri-apps / tauri-apps/plugins-workspace

[feat][deep-link] On Windows and Linux, configuring `fileAssociations` does not trigger the `onOpenUrl` method

Open
#1,990 16 comments 0 reactions 0 assignees View on GitHub
platform: linux platform: windows plugin: deep-link type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the bug
On Windows and Linux, configuring fileAssociations does not trigger the onOpenUrl method of the deep-link plugin when double-clicking a file.

`tauri.config.json`

```json
"fileAssociations": [
{
"ext": ["EcoPaste-backup"],
"mimeType": "text/plain",
"description": "EcoPaste Backup File"
}
]
```

```ts
import { onOpenUrl } from "@tauri-apps/plugin-deep-link";

onOpenUrl((urls) => {
console.log("urls", urls);
});
```

MacOS:

https://github.com/user-attachments/assets/8c48bc7f-a37a-4064-9cd2-5cec861f51f2

Windows:

https://github.com/user-attachments/assets/c9375e3e-79f5-4d6c-9b13-2802b07a9ed9

Linux:

https://github.com/user-attachments/assets/e41c468d-fe34-44a9-a1f8-39e3b463d21b

### Reproduction

_No response_

### Expected behavior

_No response_

### Full `tauri info` output

```text
[✘] Environment
- OS: Windows 10.0.22631 x86_64 (X64)
✔ WebView2: 130.0.2849.56
✘ Couldn't detect any Visual Studio or VS Build Tools instance with MSVC and SDK components. Download from https://aka.ms/vs/17/release/vs_BuildTools.exe
✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-aarch64-pc-windows-msvc (default)
- node: 20.14.0
- pnpm: 9.10.0
- npm: 10.7.0

[-] Packages
- tauri 🦀: 2.0.6
- tauri-build 🦀: 2.0.2
- wry 🦀: 0.46.3
- tao 🦀: 0.30.5
- @tauri-apps/api : 2.0.3
- @tauri-apps/cli : 2.0.5

[-] Plugins
- tauri-plugin-deep-link 🦀: 2.0.1
- @tauri-apps/plugin-deep-link : 2.0.0
- tauri-plugin-dialog 🦀: 2.0.3
- @tauri-apps/plugin-dialog : 2.0.1
- tauri-plugin-fs 🦀: 2.0.3
- @tauri-apps/plugin-fs : 2.0.1
- tauri-plugin-updater 🦀: 2.0.2
- @tauri-apps/plugin-updater : 2.0.0
- tauri-plugin-os 🦀: 2.0.1
- @tauri-apps/plugin-os : 2.0.0
- tauri-plugin-sql 🦀: 2.0.1
- @tauri-apps/plugin-sql : 2.0.0
- tauri-plugin-autostart 🦀: 2.0.1
- @tauri-apps/plugin-autostart : 2.0.0
- tauri-plugin-log 🦀: 2.0.1
- @tauri-apps/plugin-log : 2.0.0
- tauri-plugin-process 🦀: 2.0.1
- @tauri-apps/plugin-process : 2.0.0
- tauri-plugin-shell 🦀: 2.0.2
- @tauri-apps/plugin-shell : 2.0.1
- tauri-plugin-global-shortcut 🦀: 2.0.1
- @tauri-apps/plugin-global-shortcut : 2.0.0
- tauri-plugin-single-instance 🦀: 2.0.1
- @tauri-apps/plugin-single-instance : not installed!

[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite
```

### Stack trace

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.