Skip to content

feat: add Web Share Target support#31

Open
VCTGomes wants to merge 1 commit intolocalsend:mainfrom
VCTGomes:feat/web-share-target
Open

feat: add Web Share Target support#31
VCTGomes wants to merge 1 commit intolocalsend:mainfrom
VCTGomes:feat/web-share-target

Conversation

@VCTGomes
Copy link
Copy Markdown

What

Adds Web Share Target API support, allowing the installed PWA to appear
in the native share dialog on Android and other supported platforms.

How it works

  • Added share_target to the PWA manifest pointing to / via POST
  • Added public/sw-share-target.js which intercepts the POST in the
    Service Worker, extracts the shared files and forwards them to the
    app via postMessage
  • Updated index.vue to listen for the postMessage and trigger
    startSendSession when the user selects a peer

Usage

  1. Install the PWA on Android
  2. Share any file from any app
  3. Select LocalSend Web from the share dialog
  4. Select the peer to send to

Notes

  • Requires the PWA to be installed
  • Works with any file type (*/*)
  • If multiple peers are available, the user selects which one to send to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant