MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / preloadCSS

Method preloadCSS

src/js/modules/resource-hints.js:271–285  ·  view source on GitHub ↗

* Preload critical CSS

(href)

Source from the content-addressed store, hash-verified

269 * Preload critical CSS
270 */
271 preloadCSS(href) {
272 const link = this.createLink({
273 rel: 'preload',
274 href,
275 as: 'style',
276 onload: "this.onload=null;this.rel='stylesheet'"
277 });
278
279 // Fallback for browsers that don't support preload
280 setTimeout(() => {
281 if (link.rel !== 'stylesheet') {
282 link.rel = 'stylesheet';
283 }
284 }, 100);
285 }
286
287 /**
288 * Get all active resource hints

Callers

nothing calls this directly

Calls 1

createLinkMethod · 0.95

Tested by

no test coverage detected