Detect state of widget on page

If you need to check on a page where is included any LiveAgent widget if the widget is opened or not, you can use following javascript function:


A function returns true if any widget on the page is opened (e.g. from chat button included in your page was started chat), otherwise returns false.

1. Example (widget closed)



2. Example - widget opened: