function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anja IshmukhametovaAnja Ishmukhametova 

how to get event that popup-livechat is opened and customers to be able to chat with an agent

i do this way: 

i dont use VisualSource, and
for example windowLiveChat = my custom name of popup-livechat-window. 
var getReference = function() {
// to get a reference to popup
var w = window.open("", windowLiveChat);
return w;
}
var buttonCallback = function(e) {

            if (e == liveagent.BUTTON_EVENT.BUTTON_AVAILABLE && getReference()) {
           //window opened and customers service able to chatting
           }
            if (e == liveagent.BUTTON_EVENT.BUTTON_UNAVAILABLE && getReference() === undefined) {
     //window closed and customers service offline
         }
            if (e == liveagent.BUTTON_EVENT.BUTTON_ACCEPTED) {console.log('BUTTON_ACCEPTED')}
            if (e == liveagent.BUTTON_EVENT.BUTTON_REJECTED) {console.log('BUTTON_REJECTED')}

        }

liveagent.addButtonEventHandler('<%=LiveAgentButtonId %>', buttonCallback);
liveagent.init('<%=LiveAgentInitUrl %>', '<%=LiveAgentDeploymentId %>', '<%=LiveAgentDeveloperId %>');

//start chat
liveagent.startChatWithWindow(chartBtnId, windowLiveChat);

My question : 
1. is it possible use  REST liveagen API and call something  : liveagen.someFunction() - in parent window  to get DATA about child window. DATA = //for example [chat session is opened, chat is closed]
so i didnt find in PDF  :  http://www.salesforce.com/us/developer/docs/live_agent_dev/live_agent_dev_guide.pdf  

2.  also i can init my own chat-window , using VisualSource, and then using
liveagent.addEventListener(liveagent.chasitor.Events.CHAT_REQUEST_SUCCESSFUL,
myCallBack);
liveagent.addEventListener(liveagent.chasitor.Events.CHAT_ESTABLISHED, newagent);
liveagent.addEventListener(liveagent.chasitor.Events.AGENT_CHAT_TRANSFERRED, newagent);

but if i dont want use VisualForce ? 



thx
Anja IshmukhametovaAnja Ishmukhametova
i dont use Custom-LiveChat-Popup by VisualForce.