A client-side script can be injected into the message which can lead to an attack. The XSS Filter Extension helps you to sanitize the messages. This is applicable only for the Web SDK.Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-release-ios-chat-uikit-v5-1-2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Extension settings
- Login to CometChat and select your app.
- Go to the Extensions section and enable the XSS Filter extension.
- Open up the Settings and choose to Drop messages with XSS Scripts.
How does it work?
Once the extension has been enabled from the Dashboard, recipients will receive metadata with the sanitized text. Here is a sample response:- JSON
Implementation
At the recipients’ end, from the message object, you can fetch the metadata by calling the getMetadata() method. Using this metadata, you can fetch the sanitized message.- JavaScript