Preventing a loop from occuring with chat API
When sending a chat message from the Scripting API, the chat message is no longer sent back to the chat listener. This makes it easier to avoid infinite loops.
This commit is contained in:
@@ -404,12 +404,15 @@ class IframeListener {
|
||||
* @param exceptOrigin Don't dispatch the message to exceptOrigin (to avoid infinite loops)
|
||||
*/
|
||||
sendUserInputChat(message: string, exceptOrigin?: Window) {
|
||||
this.postMessage({
|
||||
type: "userInputChat",
|
||||
data: {
|
||||
message: message,
|
||||
} as UserInputChatEvent,
|
||||
}, exceptOrigin);
|
||||
this.postMessage(
|
||||
{
|
||||
type: "userInputChat",
|
||||
data: {
|
||||
message: message,
|
||||
} as UserInputChatEvent,
|
||||
},
|
||||
exceptOrigin
|
||||
);
|
||||
}
|
||||
|
||||
sendEnterEvent(name: string) {
|
||||
|
||||
Reference in New Issue
Block a user