<script>
function startApplication() {
if (!window.runApplication) {
window.onApplicationPrepared = function() {
window.runApplication();
}
} else {
window.runApplication();
}
}
(function() {
window.DISABLE_AUTOLOAD = true;
// Performing some request needed
return fetch('https://example.com')
.then(response => response.json())
.then(data => {
// Make something with data, e.g. put to global variables
startApplication();
})
.catch(() => {
startApplication();
});
})();
</script>