Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(webchat): allow to react on message click #521

Merged
merged 4 commits into from
Aug 10, 2022

Conversation

laurentlp
Copy link
Contributor

This PR allows the developer to react to message click on the webchat. When a user clicks on any message, an event (messageClicked) is sent to the parent windows (the HTML page that embeds the webchat) that contains the message details.

@laurentlp laurentlp requested a review from EFF August 9, 2022 20:32
@laurentlp laurentlp requested a review from allardy August 9, 2022 20:33
export const postMessageToParent = (type: string, value: any, chatId?: string) => {
console.log('value', value)
console.log('data', { type, value, chatId })
window.parent?.postMessage({ type, value, chatId }, '*')

Check warning

Code scanning / CodeQL

Cross-window communication with unrestricted target origin

Sensitive data returned from [here](1) is sent to another window without origin restriction. Sensitive data returned from [here](2) is sent to another window without origin restriction. Sensitive data returned from [here](3) is sent to another window without origin restriction.
Copy link
Member

@EFF EFF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess

@laurentlp laurentlp merged commit ace6d45 into master Aug 10, 2022
@laurentlp laurentlp deleted the llp_webchat_add_message_clicked_api branch August 10, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants