const currentHead = document.head; preloadLinks.forEach(({ href, as }) => { const link = document.createElement('link'); const resourceDomain = new URL(href).hostname; link.rel = 'preload'; link.href = href; link.as = as; // Set crossOrigin attribute if the domain is different from 'aspireapp.com' if (!resourceDomain.endsWith('aspireapp.com')) { link.crossOrigin = 'anonymous'; } currentHead.appendChild(link); }); } catch (error) { console.error('Error while adding preload links:', error); } }; // Delay execution by 3 second setTimeout(() => { if ('requestIdleCallback' in window) { requestIdleCallback(execute); } else { execute(); } }, 3000); }());

天美传媒

Galih Gumelar

Galih is a seasoned writer specialising in macroeconomics, business, finance and politics. With a writing history at CNN Indonesia, The Jakarta Post, and various other reputed organisations, Galih leverages his broad range of experiences to create insightful resources for those wanting to start a business.
Latest from?
Galih Gumelar