Telling the keyword EXPAND to the chatbot, this script will expand the (maximize) the pop-up screen of a chatbot, **requires: v1 Chatbot, pop-up enabled, full-screen enabled **(untested with v2 "Beta Chatbots")
let isMaximized = false;
jQuery(document).on('input', 'input[type="text"], textarea', function(e) {
const inputValue = e.target.value.trim();
if (inputValue === 'EXPAND' && !isMaximized) {
const maximizeButton = document.querySelector('.mwai-resize-button');
if (maximizeButton) {
maximizeButton.click();
isMaximized = true;
}
} else if (inputValue !== 'EXPAND') {
isMaximized = false;
}
});
This next part goes in the HEADER:
-it allows you to load jquery to enable the above coding
<head>
<!-- Other head content... -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" ></script>
</head>