Home / PWA and Offline / Share Target Link Saver

Share Target Link Saver in JavaScript, Free with Live Demo

Free link saver PWA in plain JavaScript. Install it and it appears in your phone's share menu, saving any link you share. Share links back out with the Web Share API.

Open live demoDownload HTML fileView code on GitHub
Share Target Link Saver JavaScript project: a reading list app that appears in your phone's share menu

Runs on: Web Share, Share Target. Share target: installed PWA on Android (Chrome, Edge, Samsung Internet) and ChromeOS. Web Share: Android, iPhone, Safari, Edge and Chrome on Windows and ChromeOS.

What is the Share Target Link Saver?

Install this app on Android and it shows up next to WhatsApp and email when you share a link from any app. Pick it, and the link lands in your reading list with its title.

The manifest declares a share_target, so the system opens the page with the shared title, text and URL in the address. The Web Share API sends saved links back out through the normal share sheet.

Good for

  • Reading lists and bookmark tools
  • Apps that collect links or photos
  • Making a PWA feel native on Android
  • Learning the Web Share API

What this project does

How it works

  1. Register as a targetThe manifest declares share_target with an action URL and the names of the title, text and url parameters.
  2. Receive a shareWhen you share to the app, the OS opens index.html?title=...&text=...&url=... and the page saves it.
  3. Share back outnavigator.share() opens the native share sheet with a saved link, or with a file when canShare allows it.

The key JavaScript

This is the heart of the project. The full file has the rest, including the screen layout and error handling.

// manifest.webmanifest
"share_target": {
  "action": "./index.html",
  "method": "GET",
  "params": { "title": "title", "text": "text", "url": "url" }
}

// index.html: read what was shared
const p = new URLSearchParams(location.search);
if (p.has("url") || p.has("text")) saveLink(p.get("title"), p.get("url") || p.get("text"));

// Share back out
await navigator.share({ title: link.title, url: link.url });

How to use it

  1. Click Download HTML file above.
  2. Open the file in a code editor, like VS Code.
  3. Run it from a local server with npx serve . so the camera, microphone and AI features are allowed.
  4. Change the text and colors, then upload it to GitHub Pages, Netlify or your own site. It is one file with no build step.

Questions people ask

What is a Web Share Target?

It is a manifest setting that lets an installed web app receive shares from other apps, the same way native apps do.

Does it work on iPhone?

The Web Share API for sending works in Safari. Receiving shares as a target is not supported on iOS yet.

How do I test it without a phone?

Use the Simulate a share button. It opens the page with the same address parameters the system would send.

More PWA and Offline projects