Generate <intent-filter>s for web app manifest protocol handlers
See https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/URLProtocolHandler/explainer.md for more info.
BTW, currently both good old imperative registerProtocolHandler() way and the new declarative "protocol_handlers" web app manifest's way are not supported on Android (chrome://flags/#enable-desktop-pwas-protocol-handling experimental flag is available only in Chrome on desktop).
So it would be really nice if Bubblewrap parses web app manifest's "protocol_handlers" member and generates and adds <intent-filter>s to Android manifest.
It seems generating the intent-filter is not sufficient for handling this. In the example below, the intent-filter would enable the app to handle web+jnglstore:// intents. But we also need to translate web+jnglstore://example to https://domain.com/shop?for=example.
{
"protocol": "web+jnglstore",
"url": "/shop?for=%s"
}
We can probably implement this in getLaunchingUrl()
@ibrahimkarahan would this work for Trusted Web Activities on Chrome OS too.
@andreban Can this approach be applied to WebAPK too?
@andreban Can this approach be applied to WebAPK too?
I'm not familiar with the WebAPK codebase. @PEConn may know.
@rayankans @PEConn PTAL.
I had a brief look through, it seems feasible to implement this for WebAPKs.
Chrome OS uses web manifest for protocol handlers, so generating intent filters is not required as long as the web manifest is set up properly.
Related: https://developer.chrome.com/docs/android/trusted-web-activity/web-share-target/