Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add file association support, closes #3736 #4320

Merged
merged 50 commits into from
Jul 16, 2023

Conversation

meowtec
Copy link
Contributor

@meowtec meowtec commented Jun 12, 2022

Screen Shot 2022-06-21 at 13 08 28

Screen Shot 2022-06-21 at 13 08 51

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

ref: #3736

Some apps like a picture viewer or a file editor would need a function that the user can right-click on a file and Open with the app.

In some systems such as windows, this comments (#918 (comment)) may work.

But in macOS, it is required to:

  1. Add CFBundleDocumentTypes to the plist file, otherwise we CAN NOT choose the app for opening file because the app is disabled in the Open With app list.
  2. Use NSApplicationDelegate application:openFile to handle the files.

NOTICE: this MR broken because some feature of tauri-apps/tao#422 is required

@meowtec meowtec force-pushed the feat/file-association branch from 291d764 to dc02143 Compare June 12, 2022 04:44
@meowtec meowtec marked this pull request as ready for review June 12, 2022 04:44
@meowtec meowtec requested review from a team June 12, 2022 04:44
@meowtec meowtec requested a review from a team as a code owner June 12, 2022 04:44
@meowtec meowtec force-pushed the feat/file-association branch from 821d383 to 54b05cb Compare June 16, 2022 03:10
meowtec referenced this pull request in meowtec/tauri Jun 17, 2022
@meowtec
Copy link
Contributor Author

meowtec commented Jun 21, 2022

@lucasfernog Would you take a look at this?

@lucasfernog
Copy link
Member

Thanks for the PR @meowtec I'll take a look as soon as we're ready to start merging new features.

@meowtec meowtec force-pushed the feat/file-association branch from 54b05cb to f6a04cf Compare June 23, 2022 15:17
@meowtec meowtec requested a review from a team as a code owner June 23, 2022 15:17
@JonasKruckenberg
Copy link
Member

We require all commits to be signed across Tauri's repositories. So while we wait for a plan on how we want to handle features going forward, you can use the time to sign your commits.

Follow this guide to s set up commit signing.

@meowtec meowtec force-pushed the feat/file-association branch 4 times, most recently from e2d0a7a to 9a3740a Compare June 24, 2022 07:00
@meowtec
Copy link
Contributor Author

meowtec commented Jun 24, 2022

We require all commits to be signed across Tauri's repositories. So while we wait for a plan on how we want to handle features going forward, you can use the time to sign your commits.

Follow this guide to s set up commit signing.

@JonasKruckenberg I have signed theme. Is there something incorrect?

@meowtec meowtec force-pushed the feat/file-association branch from 9a3740a to e7af0c2 Compare June 24, 2022 09:57
@meowtec meowtec force-pushed the feat/file-association branch from e7af0c2 to ef8b8dc Compare June 26, 2022 14:11
@meowtec
Copy link
Contributor Author

meowtec commented Jun 26, 2022

Update: This change shoud be compatible with deep-link (#323), and here is the demo code for macOS: https://github.com/meowtec/tauri/tree/feat/deep-link-mac:

Screen Shot 2022-06-27 at 00 36 12

Screen Shot 2022-06-27 at 00 36 28

This PR should be transformed to draft as i am trying to implement protocol in Windows and Linux.

@FabianLars FabianLars marked this pull request as draft June 26, 2022 17:29
@FabianLars
Copy link
Member

FabianLars commented Jun 26, 2022

@meowtec imo it would be fine to let this PR focus on the file associations, but if you want to do it anyway, i have working implementations for Linux and Windows here: https://github.com/FabianLars/tauri-plugin-deep-link (Just the register and maybe the unregister functions are of interest).

Edit: I planned on splitting that repo into 2 crates, one just for registering the protocols. Would that help you here?

@meowtec
Copy link
Contributor Author

meowtec commented Jun 27, 2022

https://github.com/FabianLars/tauri-plugin-deep-link

It looks better to make both file associations and deep-link PRs separated.

@meowtec meowtec force-pushed the feat/file-association branch 4 times, most recently from 025ccfc to 1ffaf70 Compare June 28, 2022 05:30
@lucasfernog
Copy link
Member

lucasfernog commented Jul 13, 2023

This is now just waiting on tao 0.21 and wry 0.30.

@lucasfernog
Copy link
Member

I just destroyed my VM testing some NSIS changes 🤡

@lucasfernog lucasfernog requested a review from amrbashir July 14, 2023 23:36
@lucasfernog
Copy link
Member

I've removed the opened event (previously called open-url) because we need a better API to send this information to the webview (the opened event is triggered before the window is created on the first call, and there's no way to get the same information on Windows/Linux - we'd need to expose the CLI args).

@lucasfernog lucasfernog merged commit 3b98141 into tauri-apps:dev Jul 16, 2023
@tnrich
Copy link

tnrich commented Sep 7, 2023

So.. did this make it in? I'm not seeing it in the tauri docs? Thanks!

@lorenzolewis
Copy link
Member

Hi @tnrich , I followed this question up here: #3736 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 In audit
Development

Successfully merging this pull request may close these issues.