I found the JavaScript file that's causing the problem. Its URL is https://www.medlife.ro/modules/custom/medlife_chatbot/js/chatbot.js?ti9r7q
Code: Select all
(function ($, Drupal, drupalSettings) {
Drupal.behaviors.chatbotIntegration = {
attach: function (context, settings) {
// Check if the chatbot initialization settings are available.
const elements = once('body-chat-bot', 'body', context);
elements.forEach(function (element) {
var $context = $(element);
window.addEventListener("load", function (e) {
setTimeout(function (){
Drupal.ajax({url: '/chatbot'}).execute();
},1000)
$(document).on( "ajaxComplete", function( event, request, settings ) {
if($.active == 1){
$('body').removeClass('loading');
}
});
})
var $logoutBtn = $('.top-spacer-account .navbar .dropdown-menu .dropdown-item');
$logoutBtn.on('click', function() {
document.cookie = "chatbotVisible=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "druidConversationToken=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "druidWebChatIsOpened=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
localStorage.removeItem('userToken');
localStorage.removeItem('userTokenExpiration');
sessionStorage.removeItem('userToken');
sessionStorage.removeItem('userTokenExpiration');
if (drupalSettings && drupalSettings.medlife_chatbot && drupalSettings.medlife_chatbot.queryParams) {
for (const key in drupalSettings.medlife_chatbot.queryParams) {
if (drupalSettings.medlife_chatbot.queryParams.hasOwnProperty(key)) {
drupalSettings.medlife_chatbot.queryParams[key] = '';
}
}
}
});
})
}
};
})(jQuery, Drupal, drupalSettings);
Code: Select all
(function ($, Drupal, drupalSettings) {
Code: Select all
})(jQuery, Drupal, drupalSettings);
Code: Select all
[`/medlife.ro/`, `/.*chatbot\.js.*/`, [`/(function.*)\$(.*\n)/`, `$1jQuery$2`]]
It's interesting that Firefox doesn't crash, even though the "chatbot.js" JavaScript file it uses is identical to the one used by Pale Moon:




