Skip to content

[Feature] Whether the embed mode of the chat window can support postMessage triggering the chat window to automatically open and enter questions to automatically submit. #3051

Closed
@greper

Description

@greper

MaxKB Version

1.10.7-lts

Please describe your needs or suggestions for improvements

当嵌入聊天窗口到宿主网站里面时,用户想点击宿主网站内的一个按钮,然后触发机器人聊天窗口打开,并自动创建一个新会话,输入问题,点击发送按钮。

Please describe the solution you suggest

需要使用iframe.contentWindow.postMessage发送消息方式触发。
期望的接口定义如下:

type openOpts = {
 q: string,
 autoSend?:boolean,
 newSession?:boolean
}

iframe.contentWindow.postMessage("open",{
 q: "请帮我分析此故障:xxxxxxxxxx",
 autoSend:true  
 newSession: true
})

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions