Webchat JS code does not work on IE
I'm using the sample code from the Readme page with the secret for my bot in my web page. works fine on chrome and firefox. In IE, I get a Promise related error and the bot does not load.
This is the error that I get on the web developer console:
....... 'Promise' is undefined .......
Hi @raghukrishnamoorthy, Is your target IE11? Do you use Web Chat CDN?
In case of ES5 browsers like IE11, you need to use Web Chat CDN with ES5 polyfills (webchat-es5.js).
Sample - Getting started with Web Chat CDN with ES5 polyfills
For example, you should rewrite such us the following code, so I guess it works.
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
thanks @nt-7 for the help. Please see https://github.com/Microsoft/BotFramework-WebChat/issues/1489 for more information.
After replacing the new cdn link for es5 i'm getting a "Refused to set unsafe header "User-Agent" error on chrome on every message sent to the bot.
Also, the CSS classes for all the controls are completely different from the CSS classes that you get when you use the non es5 cdn link.
What do i do now?
Also the es5 cdn has a missing feature that is present in the latest/webchat.js cdn link. It has new directLine method signature with conversation Id and secret/token as parameters instead of just secret/token. Which CDN do i use now?
@raghukrishnamoorthy could you share both CDN links that you were using?
Regarding your comment about the CSS classes, I'm not sure what would cause this. Is it possible you used /botchat-es5.js/ instead of /webchat-es5.js/? For your second comment, it sounds like you may be using /latest/ for the webchat.js and /master/ for the es5 build, but I'd like to confirm.
@compulim could you weigh in on the User-Agent errors?
- This was the CDN giving me the user agent error on chrome.
- This was the CDN I was already using
- And this is the recommended CDN for direct line that takes the conversation ID parameter in addition to secret/token.
Sorry for the formatting mess. I'm on mobile.
Thanks @raghukrishnamoorthy.
Also the es5 cdn has a missing feature that is present in the latest/webchat.js cdn link. It has new directLine method signature with conversation Id and secret/token as parameters instead of just secret/token. Which CDN do i use now?
Regarding your comment quoted above, I believe this has to do with using /latest/ versus /master/. We have had a few PR's improving the DL signature here and here.
Latest reflects our most recent official release (4.2), and does not include our most recent changes. If you are in need of those changes immediately, you are welcome to use this CDN: https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js. Once we release 4.3, you are welcome to switch back to latest if you'd like.
When you have the chance, could you share a screencap of the differences in CSS classes between es5 and non-es5 link? I'm hoping this will help me figure out what's going on there.
Regarding the User-Agent issue, this is a bug in the DirectLine JS https://github.com/Microsoft/BotFramework-DirectLineJS/issues/152 and will be resolved in the /master/ bits once we get this PR merged in: https://github.com/Microsoft/BotFramework-WebChat/pull/1676
Any idea on when this merge might happen?
#1676 was merged in a few days ago and master bits will have updated DLJS. latest will have these changes at our 4.3 release in a few weeks.
@corinagum Fantastic. Thank you.