Files
liceo-ariosto/media/system/js/keepalive.min.js
2025-06-17 11:53:18 +02:00

1 line
578 B
JavaScript

if(!window.Joomla)throw new Error("Joomla API was not properly initialised");const keepAliveOptions=Joomla.getOptions("system.keepalive"),keepAliveInterval=keepAliveOptions&&keepAliveOptions.interval?parseInt(keepAliveOptions.interval,10):45e3;let keepAliveUri=keepAliveOptions&&keepAliveOptions.uri?keepAliveOptions.uri.replace(/&/g,"&"):"";if(""===keepAliveUri){const e=Joomla.getOptions("system.paths");keepAliveUri=`${e?`${e.root}/index.php`:window.location.pathname}?option=com_ajax&format=json`}setInterval((()=>fetch(keepAliveUri,{method:"POST"})),keepAliveInterval);