➡️ Open the demo ⬅️
This is an email client installable app (which doesn't actually send and receive emails) meant to demonstrate the PWA protocol handling feature.
The demo shows a list of received emails, and a compose button that displays a panel to compose a new email when clicked.
The app can be installed on the device, and upon installation will register a protocol handler for mailto
.
When a mailto
link is used, the operating system should propose the installed demo app as a choice to the user to handle that link. If the user chooses this demo app, it will be launched, and the compose panel will appear, pre-filled with the email address.
The 2 interesting pieces of code here are:
- The
protocol_handlers
member in the manifest. - The way protocol handling requests are detected and used in script.js.
- Open the app.
- Install the app using the App available button in the URL bar.
- Open the demo page
- Click the
mailto
link on that page.