Definition
share_target (manifest field)
share_target is a manifest object, for example {"action": "/share", "method": "POST", "enctype": "multipart/form-data", "params": {"title": "title", "text": "text", "url": "url", "files": [{"name": "media", "accept": ["image/*"]}]}}, that adds the installed PWA as a destination in the operating system's native share sheet.
When a user shares a photo or link from another app and picks your PWA, the browser sends a request to the action URL with the declared method and encoding, which your service worker or server route must handle like any form submission.
File sharing requires method: "POST" and enctype: "multipart/form-data"; GET-based text/url sharing is simpler and works without a service worker at all since it is just a query-string navigation.
share_target only activates once the app is installed — it does not register the site as a share target while it is merely open in a tab, which is a common point of confusion during testing.
Chrome for Android and desktop support share_target broadly; iOS Safari does not support registering installed web apps as native share-sheet targets as of this writing.