mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-11-19 13:13:46 +00:00
Update index.html
打开文章时,开头附近的第一张配图和正文同时开始下载。
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user