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); }());

天美传媒

Marissa Saini

Marissa is a seasoned writer and an avid trendspotter across business finance, personal finance, travel and lifestyle industries. With writing history at SingSaver, INK, and ohmyhome, Marissa leverages her broad range of experiences to simplify finance and make readers financially savvy.
Latest from?
Marissa Saini