# Automatically opening live chat window with Rocket.Chat script

**URL:** <https://forums.rocket.chat/t/automatically-opening-live-chat-window-with-rocket-chat-script/17532>\
**Category:** Community Support\
**Created:** [August 7, 2023, 10:52am UTC](https://forums.rocket.chat/t/automatically-opening-live-chat-window-with-rocket-chat-script/17532 "2023-08-07T10:52:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaankeremm](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kaankeremm](https://forums.rocket.chat/u/kaankeremm)\
**Post date:** [August 7, 2023, 10:52am UTC](https://forums.rocket.chat/t/automatically-opening-live-chat-window-with-rocket-chat-script/17532/1 "2023-08-07T10:52:34Z")

</div>

Hello,

I have integrated the Rocket.Chat live chat script into my webpage. It automatically appears in the bottom-right corner without any issues.

However, I want it to be activated only by a button I added to my website. I’m achieving this with onClick, but now, due to the script being loaded, an additional click is required to open the live chat window.

I want to create a button that, when clicked, will automatically load the script and open a new chat window. How can I accomplish this?

Thanks in advance. Regards.

---

<div class="post-metadata">

**Author:** ![paymanzafar](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@paymanzafar](https://forums.rocket.chat/u/paymanzafar)\
**Post date:** [August 29, 2023, 7:37am UTC](https://forums.rocket.chat/t/automatically-opening-live-chat-window-with-rocket-chat-script/17532/2 "2023-08-29T07:37:59Z")

</div>

Hi.

Add the following code after the Omnichannel script:

RocketChat(function() {  
this.maximizeWidget();  
});
