Remix.run Logo
goranmoomin 16 hours ago

This is a bit tangent, but does anyone know how to block an app from ever deciding to become a file handler on macOS?

Every time I install Chrome on my machine (for testing purposes), macOS decides that Chrome is going to be the default file handler for a bunch of file associations, including HTML, WebP, and so on… and I have to figure out which was which for all of the mappings (which is super frustrating).

I can read Info.plist from the bundle of the specific app (in this case, Google Chrome) that declares all of the UTIs, and then figure out which file associations that Chrome has messed up, but I don’t know how to get the default file associations (if it was not Chrome) before it.

AdieuToLogic 12 hours ago | parent | next [-]

> This is a bit tangent, but does anyone know how to block an app from ever deciding to become a file handler on macOS?

The information below does not "block an app" from taking over file handler associations. It may be beneficial on its own and/or provide a starting point for further exploration.

> Every time I install Chrome on my machine (for testing purposes), macOS decides that Chrome is going to be the default file handler for a bunch of file associations, including HTML, WebP, and so on… and I have to figure out which was which for all of the mappings (which is super frustrating).

The following command can display current file extension associations for a user account:

  plutil -convert xml1 \
    ~/Library/Preferences/com.apple.LaunchServices.plist \
    -o -
In the XML output of the above should be the associations. As for determining changes, if Time Machine has been enabled, then changes to this plist can be identified.

Also regarding a Chrome OS-X/macOS installation - it installs plists for unconditional background updates. This may not be a desirable feature.

philocalyst 15 hours ago | parent | prev [-]

MacOS doesn't give any way to block an association from happening, I'm assuming they're using the same API's under the hood that Duti is using, and the only way you could block that from being accessed is by disabling the Launch services API.

In the next release of Infat, I'm introducing listing the openers from the plist (As you're doing now). If you record these values, then get their set defaults through infat, you could put those into your config and load from you config whenever they're overriden!

Best I got... Shameless promotion