microsoft / microsoft/BotFramework-WebChat
Developers should be able to set their own User Agent
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 1.6k
- Avg merge
- 22h 58m
- Merged PRs (30d)
- 2
Description
Description
Currently, Web Chat is responsible for handling the User Agent string in the createDirectLine function and does not allow developers to append to or replace it with their own user agent. We should change this behavior to allow developers to modify Web Chat's user agent string.
In pull request #2101, @compulim listed three approaches to letting developers modify the user agent string.
- Devs can somehow get/construct Web Chat default user agent string, and they should append it when they set
botAgent- Devs can set
appNameandappVersionand we help append to the bot agent- Devs set bot agent, but internally in Web Chat, we append to it
- Not how other systems handle user agent
Of the three, I believe the first option is the best approach since it's more in line with how other platforms handle user agent - Facebook, Instagram, and Twitter - and gives the developer more freedom; however, this option does imply that the developer is responsible for appending Web Chat's user agent - "(webchat/x.y.z (Full)." This behavior should probably be mirrored in the DirectLineJs package as well.
Additional Context
Related to #1985
[Enhancement]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the createDirectLine function and inspect how Web Chat currently handles its User Agent string. Review the three approaches described in pull request #2101 and consider how the selected behavior should be mirrored in the DirectLineJs package. Done means developers can append to or replace the User Agent as specified, with the Web Chat behavior consistent across both packages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100