简体   繁体   English

DirectLineJS在FireFox中不起作用,在Edge和Chrome中工作

[英]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.

相关问题 Javascript在Firefox / IE中不起作用,但在Chrome中有效 - Javascript isn't working in Firefox/IE but works in Chrome .pause() 在 Chrome 和 Firefox 中不起作用,但在 Safari 中工作正常 - .pause() isn't working in Chrome & Firefox, but works fine in Safari JavaScript 在 Firefox、Chrome 中不起作用 - 在 IE、Edge 中有效 - JavaScript not working in Firefox, Chrome - works in IE, Edge 登录可以在Chrome和Firefox上使用,但不能在Edge上使用 - Login works on Chrome and Firefox but not on Edge Element.scrollIntoView(); 不在 Chrome 和 Edge 中工作,在 Firefox 中工作? - Element.scrollIntoView(); Not working in Chrome and Edge, Works in Firefox? jquery 适用于 Firefox、Edge,但不适用于 Chrome - jquery works in Firefox, Edge, but not Chrome ScrollTop可在Chrome和Edge中使用,但不能在Firefox中使用 - ScrollTop works in Chrome and Edge but not Firefox XPath选择在Microsoft Edge中不起作用(适用于Chrome和Firefox) - XPath selection not working in Microsoft Edge (works in Chrome and Firefox) 无法从 Express JS session 在勇敢、firefox 等浏览器以及 chrome 和 edge 中设置 cookie,cookie 无法按预期工作 - Unable to set cookie from Express JS session in brave, firefox, etc browsers and in chrome, and edge, cookie isn't working as expected js 代码适用于 firefox 但不适用于 chrome 歌剧和边缘 - a js code works on firefox but not on chrome opera and edge
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM