GoogleChromeLabs / GoogleChromeLabs/bubblewrap
Add Suffix to User-Agent or Referrer with the version of the TWA
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
Description
At the moment, the only way I am aware of that we can pass the version of the TWA app I have, is through the Start URL, adding something like /?twa=123
However, if a user accesses the app through opening a Push Notificaiton, or a link from another app/browser, that opens a specific page or so, then the version will not be passed anywhere.
**URL:** /specific-page
**Referrer:** android-app://com.mytwa
**User-Agent:** Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36
It would be nice if we could add a suffix to the current User-Agent, so we could add the version, e.g.:
**User-Agent:** Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36 **TWA/123**
Or to the Referrer:
**Referrer:** android-app://com.mytwa+v123
So we could have a reliable way of knowing what version the user is on.
Thank you!
Contributor guide
Assessment
This issue has not been assessed yet.