Commit Graph

55 Commits

Author SHA1 Message Date
Sojan Jose
714f24de11
revert: "fix(sdk): Ignore messages from a different origin and sanitizee URLs (#8879)" (#12248)
This reverts commit a42b99ada0.

fixes: #12247
2025-08-20 21:39:50 +02:00
Shivam Mishra
a42b99ada0
fix(sdk): Ignore messages from a different origin and sanitize URLs (#8879)
This PR includes some specific security related fixes

1. Validate the origin of any message events
2. Sanitize URLs before opening them

---------

Co-authored-by: Pranav <[email protected]>
Co-authored-by: Muhsin Keloth <[email protected]>
2025-08-14 14:33:32 +05:30
Sivin Varghese
5ebe8c71ec
feat: Support customizable welcome text, availability messages, and UI toggles (#11891)
# Pull Request Template

## Description

This PR allows users to dynamically pass custom welcome and availability
messages, along with UI feature toggles, via `window.chatwootSettings`.
If any of the following settings are provided, the widget will use them;
otherwise, it falls back to default behavior.

**New options:**
```
window.chatwootSettings = {
  welcomeTitle: 'Need help?',                        // Custom widget title
  welcomeDescription: 'We’re here to support you.',        // Subtitle in the header
  availableMessage: 'We’re online and ready to chat!', // Shown when team is online
  unavailableMessage: 'We’re currently offline.',      // Shown when team is unavailable

  enableFileUpload: true,          // Enable file attachments
  enableEmojiPicker: true,         // Enable emoji picker in chat input
  enableEndConversation: true     // Allow users to end the conversation
}
```


Fixes
https://linear.app/chatwoot/issue/CW-4589/add-options-to-windowchatwootsettings

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

### Loom video

https://www.loom.com/share/413fc4aa59384366b071450bd19d1bf8?sid=ff30fb4c-267c-4beb-80ab-d6f583aa960d

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Muhsin Keloth <[email protected]>
2025-07-08 14:26:00 -07:00
Shivam Mishra
ea3ef9064b
feat: handle rails turbo morphing (#11422)
Co-authored-by: Sivin Varghese <[email protected]>
2025-05-07 10:22:08 +05:30
David Kubeš
ecc95478b9
feat: widget opened and closed events (#11240)
Fixes #9272

---------

Co-authored-by: Sivin Varghese <[email protected]>
2025-04-24 17:01:39 +05:30
Shivam Mishra
9cf2bd284b
feat: Support card message postback event as widget event (#11133)
Fixes https://github.com/chatwoot/chatwoot/issues/5956
Fixes https://github.com/chatwoot/chatwoot/issues/1895
2025-03-20 12:00:24 -07:00
Sivin Varghese
abf376940d
fix: Avoid overflow caused by the empty span element (#9753)
Some checks are pending
Publish Chatwoot CE docker images / build (push) Waiting to run
Run Chatwoot CE spec / test (push) Waiting to run
Run Response Bot spec / test (push) Waiting to run
This PR addresses an issue with the `createNotificationBubble` function, which generates an empty `span` element with the class `woot--notification`. This `span` element is currently not utilized anywhere in the code and lacks associated CSS, leading to an overflow issue, specifically in the Firefox browser. It solves the website overflow issue by removing this unused `span` element. This change is unrelated to the unread notification dot, which is working as before.

Fixes https://linear.app/chatwoot/issue/PR-1098/missing-css-for-woot-notification-div
2024-07-10 19:56:46 -07:00
Sivin Varghese
9689bbf0dd
feat: Adds the ability to disable the "new message notification" popup (#9594)
Some checks are pending
Publish Chatwoot CE docker images / build (push) Waiting to run
Run Chatwoot CE spec / test (push) Waiting to run
Run Response Bot spec / test (push) Waiting to run
2024-06-11 08:14:58 +05:30
Shivam Mishra
bc8736c08e
fix: widget does not load when navigating on pages with view transition [CW-3249] (#9443)
* feat: add ids to each element

* feat: restore elements for apps that use view transitions

* fix: remove generator check condition

* feat: handle turbolinks

* fix: new body handling

* chore: undo debug changes
2024-05-15 10:45:03 +05:30
Sojan Jose
e4de366b8d
feat: Add an option to listen to the start conversation click events (#8038)
This PR will add a new event chatwoot:on-start-conversation to the chat widget, which you can listen to and trigger custom interactions on your end.

Co-authored-by: Pranav Raj S <[email protected]>
2023-10-03 18:01:40 -07:00
Nithin David Thomas
1017903ee1
fix: Adds domain option to user cookies set by SDK [CW-352] (#7070)
* fix: Adds domain option to user cookies set by SDK

* Adds domain to init event from chatwootSettings variable

* Testing multiple domains on heroku

* Updates with sdk from staging

* Removes sdk init code

* Testing why cookie is not getting set

* Cleans up testing code

* Refactors code to fix codeclimate issues

* Update app/javascript/sdk/cookieHelpers.js

Co-authored-by: Shivam Mishra <[email protected]>

* Adds test cases for setCookieWithDomain

---------

Co-authored-by: Muhsin Keloth <[email protected]>
Co-authored-by: Shivam Mishra <[email protected]>
2023-06-08 14:27:49 +05:30
Nithin David Thomas
2f2cdd7e7c
feat: Hides dismissed campaigns while browsing [cw-33] (#6842)
* Chore: moves localstorage helper as a shared utility and refactors constants

* Refactors constants file

* feat: Hides dismissed campaigns while browsing

* Snoozes all campaigns for an hour after dismissing

* Fixes error with date parsing

* Snooze ongoing campaigns

* Review fixes

---------

Co-authored-by: Muhsin Keloth <[email protected]>
2023-04-25 22:38:36 +05:30
Pranav Raj S
8db40f2d82
chore: Add chatwoot:on-message event (#6425) 2023-02-09 12:48:22 -08:00
Pranav Raj S
ffb4bd0109
feat: Add the support for video calls with Dyte in the live-chat widget (#6208)
Co-authored-by: Nithin David Thomas <[email protected]>
Co-authored-by: iamsivin <[email protected]>
2023-01-09 11:52:31 -08:00
Pranav Raj S
6ffb7fe34e chore: Refactor audio notification helper (#6148) 2022-12-30 13:54:37 -08:00
Sivin Varghese
2972319026
fix: Update colors in widget buttons to fix invalid colors (#6033)
Co-authored-by: nithindavid <[email protected]>
Co-authored-by: Pranav Raj S <[email protected]>
2022-12-14 15:21:20 -08:00
David Kubeš
0c8f744c33
chore: Remove unnecessary methods and polyfills (#5614) 2022-10-12 14:42:06 -07:00
Sojan Jose
f71980bd95
chore: Enhance contact merge action for identified users (#4886)
- Discard conflicting keys 
- Do not merge if there is already an identified contact

Co-authored-by: Pranav Raj S <[email protected]>
2022-06-23 15:48:56 +05:30
Pranav Raj S
2e0d43c093
chore: Use different files for widget and dashboard audio alert (#4637) 2022-05-06 20:19:36 +05:30
Fayaz Ahmed
ef850eda0f
feat: Add the SDK method to programatically toggle live chat bubble (#4223)
Co-authored-by: Pranav Raj S <[email protected]>
2022-05-06 19:30:48 +05:30
Sivin Varghese
caee9535f1
feat: Support Dark mode for the widget (#4137)
Co-authored-by: Pranav Raj S <[email protected]>
2022-04-01 20:59:03 +05:30
Fayaz Ahmed
30ac8054ba
feat: Add an SDK method for opening conversation in popout window (#4232) 2022-03-28 13:31:51 +05:30
Pranav Raj S
971755b845
fix: Remove unnecessary dispatchWindowEvent (#4288) 2022-03-25 20:25:07 +05:30
Nithin David Thomas
3c3b6f90c7
fix: Add base_url to the audio notification file (#4116) 2022-03-10 20:40:47 +05:30
Sojan Jose
11adfd2384
chore: remove unnecessary dependent destroy (#4104) 2022-03-03 13:02:02 +05:30
Sivin Varghese
a3cb26a317
fix: AudioContext warning when loading widget on Chrome (#3956)
* fix: AudioContext warning when loading widget on Chrome

* minor fixes

* Minor fixes

* adds event on document

* Play audio from parent window through SDK

* Adds notification to dashboard

Co-authored-by: Nithin David Thomas <[email protected]>
Co-authored-by: Vishnu Narayanan <[email protected]>
2022-02-28 21:43:24 +05:30
Pranav Raj S
87a6266ddc
fix: Add resetTriggered flag to fix reset loop (#4079) 2022-02-28 14:53:11 +05:30
Pranav Raj S
6c94768bdb
feat: Add flat design for widget (#4065) 2022-02-25 16:18:18 +05:30
Muhsin Keloth
7ba24b90c4
feat: Add chatwoot:error sdk event (#3998) 2022-02-21 09:40:11 +05:30
Nithin David Thomas
94209d29cb
fix: Fixes widget unread view blocking parent page (#3658)
Co-authored-by: Pranav <[email protected]>
Co-authored-by: Muhsin Keloth <[email protected]>
Co-authored-by: Sivin Varghese <[email protected]>
2022-01-12 12:27:16 -08:00
Pranav Raj S
9c31d7c672
feat: Use vue-router on widget route management (#3415)
* feat: Add vue-router to widget

Co-authored-by: Pranav <[email protected]>

* Move to dynamic imports

* Move to routerMixin

* Fix popup button display

* Remove unnecessary import

* router -> route

* Fix open state

* Fix issues

* Remove used CSS

* Fix specs

* Fix specs

* Fix widgetColor specs

* Fix mutation specs

* Fixes broken lint errors

* Fixes issues with widget flow

Co-authored-by: Nithin <[email protected]>
Co-authored-by: Nithin David <[email protected]>
Co-authored-by: Muhsin Keloth <[email protected]>
2022-01-12 16:25:27 +05:30
Pranav Raj S
2f63ebb8a6
fix: Add fixes for sentry errors (#3522)
- Add fixes for sentry errors
2021-12-09 11:50:28 +05:30
Sanju
2c3c1888f1
Enhancement: Show unread marker on widget bubble (#3390)
* add unread marker

* add removeClass in IFramehelper

* Update app/javascript/sdk/sdk.js

* Update app/javascript/sdk/sdk.js

Co-authored-by: Nithin David Thomas <[email protected]>
2021-11-25 20:25:14 +05:30
Pranav Raj S
1a8b8f0900
chore: Move referrerHost to appConfig store (#3433) 2021-11-22 15:05:29 +05:30
Aswin Dev P.S
edd0e2329f
feat: Add the ability to close and reopen the chat window via SDK (#3080) 2021-09-28 19:25:44 +05:30
koudshoorn
af1d8c0ee5
feat: Fixes #1940 WCAG support for website widget (#2071)
Co-authored-by: Kaj Oudshoorn <[email protected]>
Co-authored-by: Pranav Raj S <[email protected]>
Co-authored-by: Nithin David Thomas <[email protected]>
2021-09-02 12:13:53 +05:30
Nithin David Thomas
70d41ffcdd
fix: Smoothens out opening animation for widget (#2789) 2021-08-14 08:40:29 +05:30
Nithin David Thomas
9c257578b0
fix: Fixes unread view blocking page scroll (#2727)
* fix: Fixes unread view blocking page scroll

* Update sdk.js

* Fixes the height issue for unread view

* Fix unread message position issue

* Code climate fixes

* Fixes height issue for large messages

* Fixes height issue on unread view

Co-authored-by: Muhsin Keloth <[email protected]>
2021-08-07 11:56:15 +05:30
Muhsin Keloth
fb2f3ff89f
feat: Create campaign conversation only if user interacts with the bubble (#2335)
Co-authored-by: Pranav Raj S <[email protected]>
2021-06-15 20:09:42 +05:30
Muhsin Keloth
610a7c661e
chore: Execute campaigns based on matching URL (#2254) 2021-05-17 21:38:35 +05:30
Pranav Raj S
1b99ab3098
fix: Use exisiting bubble nodes if available (#2026) 2021-04-02 15:04:16 +05:30
Pranav Raj S
4fe29fefb4
fix: Add missing close button if bubble is hidden (#1435) 2020-11-23 10:49:28 +05:30
Pranav Raj S
666948b809
chore: Reduce the click area on Branding (#1340) 2020-10-15 00:11:47 +05:30
Pranav Raj S
45cd949c40
feat: Add a popout option on webwidget (#1174)
* feat: Add a popout option on webwidget
2020-08-28 17:39:46 +05:30
Pranav Raj S
e8912655a5
feat: Allow user to change the bubble title using SDK (#1155)
- Allow user to change the bubble title using SDK
- Add docs for enabling expanded bubble
2020-08-19 22:24:02 +05:30
Pranav Raj S
0adbc346df
feat: Add an extended bubble design for the widget (#1123)
* feat: Add a new design for chat bubble

Signed-off-by: Pranav Raj Sreepuram <[email protected]>

* Add i18n

* Fix stye issues

* Set fixed font-size

* Update docs for bubble
2020-08-09 16:07:32 +05:30
Pranav Raj S
12ee7e5d82
feat: Add chatwoot:ready event listener on window (#1091)
* feat: Add `chatwoot:ready` event listener on window

* Add specs

* Rename customEventHelper.js -> CustomEventHelper.js
2020-07-25 21:54:58 +05:30
Nithin David Thomas
49db9c5d8a
Adds unread message bubbles for widget (#943)
Co-authored-by: Sojan <[email protected]>
Co-authored-by: Pranav Raj S <[email protected]>
2020-07-08 00:04:44 +05:30
Nithin David Thomas
944fbf27b7
Enhancement: Improve scrolling on widget #954 (#955)
Co-authored-by: Pranav Raj Sreepuram <[email protected]>
2020-06-13 20:33:23 +05:30
Pranav Raj S
59f4dd7ebe
Feature: Introduce locale in web-widget SDK (#871)
* Introduce setLocale in SDK

Co-authored-by: Sojan <[email protected]>
2020-05-17 16:15:53 +05:30