Click URL to open PWA automatically

Steel Contributor

There is a flag in Canary 90.0.817.0 that I had high hopes for:

Desktop PWA URL handling

Enable web app manifests to declare URL handling behavior. Prototype implementation of: https://github.com/WICG/pwa-url-handler/blob/master/explainer.md  Mac, Windows, Linux

#enable-desktop-pwas-url-handling 

 

Its my understanding that so long as a PWA's manifest contains the right entries, with this flag enabled, clicking on a specific link should automatically open the URL in the appropriate PWA rather than in the browser.  So far, it doesn't, at least for a Twitter PWA. I tried two different ones: the one offered by an icon in the address bar at twitter.com, and the other installed by using Edge's Install this site as an app option which is apparently the same.

 

I noticed some differences between elements in the app's manifest and the ones specified in the GitHub explainer, for example:

 

"display_mode"

"display"

"url_handlers":[{"origin":"twitter.com"}]

"url_handlers": {"scope": {"matches": [ "https://twitter.com/*" ]}

 

 

How do we make this work?

 

2 Replies

Hi @Noel Burgess 

Here are a couple of sample apps with working configuration for URL handling.
Hello! (luhuangmsft.github.io)
Hello! (mandymsft.github.io)

From then DevTools Application pane, you can see that their manifests contains "url_handlers" entries:
https://luhuangmsft.github.io/pwa/manifest.json
https://mandymsft.github.io/pwa/manifest.json

web-app-origin-association files that complete the handshake:

https://luhuangmsft.github.io/.well-known/web-app-origin-association
https://mandymsft.github.io/.well-known/web-app-origin-association

mandymsft.github.io/pwa is able to handle links from luhuangmsft.github.io/pwa but not vice versa. 

To test this behavior, you should:
* use Edge 91 or above
* enable  from edge://flags

* configure the browser installation to be the default web browser in system settings
* install one or both of the sample apps

* Test with a link in other applications, a URL in run.exe (Win+R), or a URL as a command line argument. 
* Eg. $ msedge.exe https://luhuangmsft.github.io/pwa/

 

 

@LuHuangMSFT 

 

Thanks! Off to play ...