Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Protocol handling demo - Email client

➡️ Open the demo ⬅️

This is an email client installable app (which doesn't actually send and receive emails) that demonstrates the PWA protocol handling feature.

About the demo app

The demo app 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 two 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.

How to use the demo

  1. Open the app.

  2. In the Address bar, click the App available. Install Email inbox (App available icon) button.

    The app is installed.

  3. Open the demo.html page.

  4. Click the mailto link on that page.

See also