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

Pairdrop has reset all my windows file associations? #17

Closed
mundodisco8 opened this issue Feb 2, 2023 · 3 comments · Fixed by #209
Closed

Pairdrop has reset all my windows file associations? #17

mundodisco8 opened this issue Feb 2, 2023 · 3 comments · Fixed by #209
Labels
enhancement New feature or request

Comments

@mundodisco8
Copy link

Hi,

I "installed" Pairdrop in my Windows computer, but now every time I open a file, Pairdrop wants to be the default app to open that file type, and that is quite annoying.

Can you review that?

I managed to reproduce in a clean Windows Sandbox. See attached gif

Pairdrop_Small

  1. Create a text file, for example.
  2. Double click to confirm it's open with its default app, in this case notepad
  3. Install Pairdrop
  4. Open the text file again, a dialog appears suggesting Pairdrop as a potential default opener for text files.

I opened the file associations setting in Windows. Pairdrop has associated with .*.

image

I removed it from the registry, but I did a search for its key (Chrome.2803962851) and it appears hundreds of times for different, odd, extensions, I can't remove them by hand

image

I uninstalled the app, and the issue disappears, but the registry entries remain.

@schlagmichdoch
Copy link
Owner

Hi @mundodisco8
Thanks for including screenshots in your issue!

This issue is only present when installing PairDrop as PWA with the File Handler API enabled.

With this experimental API enabled, on installation, the PWA registers itself as an application to open certain files with. The app is then included in the "open with" dialog and Windows allows you to open certain files with this app. Propably PairDrop is registered as the default app for a certain file type if no other app on the machine is associated with this file type.
As we want to send any file with PairDrop via the context menu I tried to add as many file types as possible.
This is all desired behaviour and enhances the app a lot IMO.

If you take a look at the New App Alert ("Select an app to open this [...] file with") you can see that the default app has not changed upon installation (still Notepad for .txt) but Windows simply alerts you that there is a new app installed that can handle this file as well.
Although you only have to select the default app and press "Always" once for every file type you open, I see the inconvenience.

As far as I know, this behaviour cannot be changed via the apps manifest as it is standard Windows behaviour. It is however possible to prevent windows from opening the new app alert completely via the registry:
https://www.elevenforum.com/t/enable-or-disable-open-with-when-new-app-installed-in-windows-11.5292/#Two
(The naming in the article is a little misleading: You need to do step 3 'Disable Open with when New App Installed')

Independently from PairDrop, I like this behaviour better for any installation.

What do you think? Does that solve your issue?

@schlagmichdoch schlagmichdoch added the enhancement New feature or request label Feb 2, 2023
@mundodisco8
Copy link
Author

I tried the registry edition trick on Windows Sandbox and it didn't work, but I don't know if that was caused by the sandbox itself, somehow. If I try it outside of the sandbox I will report. In any case, I'm not comfortable disabling that functionality completely.

I see that this behaviour is by design then, and while I humbly disagree, I totally see your point and the value of your proposition.

In any case, after toying around a bit, I think I cracked it. If I install the app with Chrome, I can disable the access to the File Handling API for just the Pairdrop app (Hamburger menu, App Info, Settings)

image

I haven't managed to find the equivalent toggle for the case of the app being installed from Edge, but who doesn't have 3 or 4 web browsers installed on their computer, right? 😄

This does exactly what I personally need. Given that the issue is not a bug, I will close it.

@schlagmichdoch
Copy link
Owner

Did you check, that the result of the registry edition was "NoNewAppAlert"=dword:00000001?

Perfect that you found a solution! I didn't know that the File Handling API is activated by default on Chromium. Nice!

That the setting is not offered on Edge is weird. I even tried to open the URL via the app id edge://app-settings/APP_ID but I'm just redirected to the normal settings page without a setting to deactivate the File Handling API. Edge is weird 🤦‍♂️

There is another possiblity though: The manifest of the web app is specified in the header. When I changed <link rel="manifest" href="manifest.json"> to <link rel="manifest" href="manifest_no_file_handlers.json"> which omits the file_handlers setting and updated the service worker afterwords, an already installed app was removed from the 'open with' dialog.

So it would be possible to create a setting which toggles the manifest replacement and serviceworker update.
I won't implement this for now but if more people find the current behaviour annoying this could be a possibility. Until then I will simply recommend your solution but with ungoogled-chromium instead: https://github.com/ungoogled-software/ungoogled-chromium (Downloads)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants