diff --git a/js/shapes/utils.js b/js/shapes/utils.js index fe527de..66a0adf 100644 --- a/js/shapes/utils.js +++ b/js/shapes/utils.js @@ -21,14 +21,9 @@ const img = new Image(); const record = { img: img, ready: false }; window.YooneSnowImageCache[imageUrl] = record; - img.onload = function(){ - var decoder = img.decode && typeof img.decode === 'function' ? img.decode() : null; - if (decoder && typeof decoder.then === 'function'){ - decoder.then(function(){ record.ready = true; }).catch(function(){ record.ready = true; }); - } else { - record.ready = true; - } - }; + try { img.decoding = 'async'; } catch(e) {} + try { img.fetchPriority = 'low'; } catch(e) {} + img.onload = function(){ record.ready = true; }; img.onerror = function(){ // 加载失败 从缓存移除避免重复错误 delete window.YooneSnowImageCache[imageUrl];