简体   繁体   中英

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. When typing in the console the command, it creates a directLine object without a conversation id; therefore, everything that I type doesn't get a response.

Here's is how I create the DirectLine object

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.

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:

"Success: A2CflFKTt5j11hPQcDtte|0000001"

In firefox no message is printed, nor error nor success.

Anybody has any idea of the reason this happens?

实际上,唯一可能的原因是firefox和Chrome的权限不同。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM