Control live chat programmatically

Status
Not open for further replies.

pierredavidbelanger

Customer
Joined
Nov 24, 2022
Messages
11
Reaction score
2
Is there a way to have more programmatic (javascript) control over how, when and where the live chat box appears or hide ?

More specifically, I have a web app, where I want my logged users (I already know how to pre-configure the visitor name and email) to be able to click a button or menu entry to show / hide the chat. So no visible bubble in the bottom right.

Also, it would be nice to somehow auto send a message or information visible to the agent on where (the section) of the app the user is in when he pop the chat.

Also, the app is deployed on many subdomains, like sub1.domain.com, sub2.domain.com, subX.domain.com. It does not seems right to create one live chat for each since subX is dynamic, but I think the CORS configuration will not allow wildcards.

Thank you, a lot !
 
Hello, Pierredavidbelanger
Unfortunately, at this moment there is no programatically way to open livechat.
I noted these ideas.
 
  • Like
Reactions: pierredavidbelanger
Ok, thank you for this quick response!

This answers my first two questions.

And for the third (about dynamic sub domains and CORS) , do you have an answer ?
 
You can try using JQuery or vanilla javascript to catch your click on something else to trigger the click on the 3CX element. We did it a couple times. You just need to find the right HTML element to trigger "click" on.

As for CORS, try using a wildcard like "https://*.yourdomain.tld"
 
You can try using JQuery or vanilla javascript to catch your click on something else to trigger the click on the 3CX element. We did it a couple times. You just need to find the right HTML element to trigger "click" on.

As for CORS, try using a wildcard like "https://*.yourdomain.tld"
Interesting!
I already identified the html element of the bubble, and can access it using $(the_bubble_element_id) for example.

So you tel me I can hide the bubble and dispatch my own click event to the bubble so the chat pop ?

That would be a good enough workaround
 
Interesting!
I already identified the html element of the bubble, and can access it using $(the_bubble_element_id) for example.

So you tel me I can hide the bubble and dispatch my own click event to the bubble so the chat pop ?

That would be a good enough workaround
Don't know about hiding it (but I mean, a bit of JS never hurts to try) but yes you should be able to trigger it.

Try using this in the DevTools console:

$("the element").trigger("click");
 
Wildcard style for CORS may not work in some browsers because it is not strictly by the standards.
Right way is to list the hosts separated by commas:
https://sub1.domain.com,https://sub2.domain.com etc.
 
Wildcard style for CORS may not work in some browsers because it is not strictly by the standards.
Right way is to list the hosts separated by commas:
https://sub1.domain.com,https://sub2.domain.com etc.

Yeah, that's what i was thinking.

Since we have a couple of hundred of sub domains, and they are dynamic (they come and go, based on our clients), its not a viable option to list them all.

Is there a way to disable CORS ?
 
Status
Not open for further replies.

Forum statistics

Threads
112,149
Messages
590,965
Members
165,170
Latest member
SupportRock