The search term you want is: share_target

Sometimes you don't know the name of the thing you're looking for; sometimes you have a question, but don't know how to ask it. And only when you discover the exact search term does that unlock the information you've been trying to find.

Here's an example. On macOS, lots of applications offer this native share menu. Here's a screenshot from Safari:

Screenshot of a macOS share menu

Initially I wasn't sure if "share menu" was the right term for that menu, but it looks like it is.

But what I was wondering was: was it possible to add a webapp to that menu? For example, if I have a webapp that can receive images (like Squoosh), could I "add" that webapp as an option in the macOS share menu? It seems like I should be able to.

I searched for things like "add webapp to share menu macos", "add item to share menu macos", and other similar permutations. This generally just yielded posts with instructions on how to modify the share menu items as an end user—i.e. how to add or remove specific native applications. But there was nothing I could find about programatically adding a webapp to that menu.

I also tried searches that included pwa and progressive web app, since it seemed possible that this functionality might be tied to "installing" the webapp somehow. No luck. Every few months I'd search around, find nothing useful, and then give up.

But then one day, I found the term I wanted. I actually don't remember how I found it. But the term you want is share_target! Here's the MDN link. (It's entirely possible I was just surfing around MDN and then stumbled across this—I've accidentally learned a number of things that way.)

Here are a few other helpful links:

It turns out the exact functionality I wanted has already been spec'd out! Great!

Unfortunately it seems not to be supported by Apple. I actually can't find any documentation that officially says it is or isn't supported... but adding share_target to a manifest.json doesn't have any effect. The closest documentation I could find was this WebKit GitHub issue, which suggests that the WebKit team is relatively neutral on the issue, but also suggests that they haven't actually implemented it.

Oh well. At least now I know what to search for. The official macOS way to add items to the native share menu seems to be add a "Share Extension" as a new "target" in Xcode:

Screenshot the "Share Extension" target option in Xcode

Documentation about this is also pretty scant.