Check if Salesforce Messaging for Web Chat Window is Minimized
Aug 15, 2025
Show More Show Less
View Video Transcript
0:05
Hello everyone. In this video, we are
0:07
going to see how to check whether
0:10
Salesforce messaging for web chat window
0:12
is minimized. If you have an use case
0:15
where where you wanted to check whether
0:17
Salesforce messaging for web
0:20
chat window is minimized or not then you
0:23
can make use of
0:28
on embedded messaging window minimized
0:31
event. By listening to this event, you
0:35
can
0:37
um
0:39
you can find out whether the Salesforce
0:41
messaging for web chat window is
0:43
minimized or not. My use case was very
0:46
simple. Whenever the website visitors
0:48
initiates Salesforce messaging for web
0:51
sessions and then if they minimize the
0:54
chat window, I have to alert the user
0:57
saying that the chat window is minimized
0:59
and it is not closed. Let's uh
1:03
look at a demo and then we will see the
1:06
code changes that was done to achieve
1:09
this use case.
1:12
So this is a site where my Salesforce
1:14
messaging for web is hosted. This and
1:18
the chat is started.
1:21
Uh as a website visitor I sent a message
1:24
message stating hello. Now if I minimize
1:27
this chat window, I'm getting an alert
1:31
saying that chat is not closed. It is
1:33
just minimized.
1:37
In order to achieve this,
1:41
I made use of window add event listener.
1:45
The event I'm listening is on embedded
1:48
messaging window minimized. Whenever
1:50
this event is fired,
1:53
I have added
1:55
a console.log statement using alert
1:57
method. I'm alerting the
2:00
users saying that chat is not closed. It
2:04
is just minimized. And then I have added
2:06
one more console.log statement. So using
2:09
this uh code snippet along with the
2:12
Salesforce uh embedded service code
2:15
snippet. So this is the code snippet we
2:17
usually get it in this after this
2:20
embedded service bootstrap.
2:22
Settings.language
2:24
you can add this code snippet and then
2:26
you can design as per your use case.
2:35
Please check the video description. In
2:37
the video description I have shared my
2:39
blog post. From the blog post, you
2:41
should be able to get the sample
2:44
JavaScript code which contains the
2:47
window.adde eventlister for your
2:49
reference.
2:55
I hope it was helpful.
3:02
Thank you for watching.
#Internet Software
