vuetube
Version:
A fast, lightweight, lazyload vue component acting as a thin layer over the YouTube IFrame Player API which renders fast
18 lines (14 loc) • 393 B
JavaScript
/**
* Add preconnect links to the head of the document
* @link https://www.igvita.com/2015/08/17/eliminating-roundtrips-with-preconnect/
*/
function createWarmLink(url, addCrossorigin) {
var el = document.createElement('link');
el.rel = 'preconnect';
el.href = url;
if (addCrossorigin) {
el.crossOrigin = '';
}
document.head.appendChild(el);
}
export { createWarmLink };