Update index.html

打开文章时,开头附近的第一张配图和正文同时开始下载。
This commit is contained in:
CyC2018
2026-11-06 06:58:42 +08:00
parent 48902ea6c6
commit 3a17978a41
+11
View File
@@ -32,6 +32,17 @@
link.href = href;
document.head.appendChild(link);
});
// 文章开头附近的第一张配图同时开始下载(地址由构建写入)
var images = window.CS_NOTES_FIRST_IMAGES = {}/*FIRST_IMAGES*/, image = null;
try { image = images[decodeURIComponent(path)]; } catch (error) {}
if (image) {
var hint = document.createElement('link');
hint.rel = 'preload';
hint.as = 'image';
hint.href = image;
hint.setAttribute('fetchpriority', 'high');
document.head.appendChild(hint);
}
})();
</script>
<script>