[英]DirectLineJS isn't working in FireFox, works in Edge and Chrome
In the chat UI that I made, I connect with directline as indicated in the docs (var directLine = new DirectLine.DirectLine({secret: directLineSecret});) it works perfectly with Chrome and Microsoft Edge, but with firefox it just doesn't connect. 在我创建的聊天UI中,我按照文档中的指示连接了Directline(var directLine = new DirectLine.DirectLine({secret:directLineSecret});)它与Chrome和Microsoft Edge完美结合,但与firefox完美结合t连接。 When typing in the console the command, it creates a directLine object without a conversation id;
在控制台中键入命令时,它将创建一个没有对话ID的directLine对象; therefore, everything that I type doesn't get a response.
因此,我键入的所有内容都不会得到响应。
Here's is how I create the DirectLine object 这是我创建DirectLine对象的方法
Also my listener when posting activities to directLine prints in console a message with the id on success, and the error otherwise, but none of the listeners is executing. 同样,当将活动发布到directLine时,我的监听器会在控制台中成功显示一条带有id的消息,否则返回错误,但是没有一个监听器正在执行。
var dlobj = new DirectLine.DirectLine({secret: "myDirectLineSecret"});
var activity = {
from:{
id:"User",
name: "User"
},
type: "message",
text: "I'm here"
};
dlobj.postActivity(activity)
.subscribe(
id => console.log("Success: ",id),
error => console.log("Error: ", error)
);
Output in Chrome: 在Chrome中输出:
"Success: A2CflFKTt5j11hPQcDtte|0000001" “成功:A2CflFKTt5j11hPQcDtte | 0000001”
In firefox no message is printed, nor error nor success. 在firefox中,不会打印任何消息,也不会显示错误或成功。
Anybody has any idea of the reason this happens? 有人知道发生这种情况的原因吗?
实际上,唯一可能的原因是firefox和Chrome的权限不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.