diff --git a/dist/vue-img.es6.js b/dist/vue-img.es6.js index 178d3fe..657e38c 100644 --- a/dist/vue-img.es6.js +++ b/dist/vue-img.es6.js @@ -1,10 +1,7 @@ const VueImg$1 = Object.create(null); // Check webP support -VueImg$1.canWebp = false; -const img = new Image(); -img.onload = () => { VueImg$1.canWebp = true; }; -img.src = 'data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAsAAAABBxAREYiI/gcAAABWUDggGAAAADABAJ0BKgEAAQABABwlpAADcAD+/gbQAA=='; +VueImg$1.canWebp = !![].map && document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0; // Default cdn prefix const protocol = location.protocol === 'https:' ? 'https://' : 'http://'; diff --git a/dist/vue-img.js b/dist/vue-img.js index 815e3f6..142c580 100644 --- a/dist/vue-img.js +++ b/dist/vue-img.js @@ -7,10 +7,7 @@ var VueImg$1 = Object.create(null); // Check webP support -VueImg$1.canWebp = false; -var img = new Image(); -img.onload = function () { VueImg$1.canWebp = true; }; -img.src = 'data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAsAAAABBxAREYiI/gcAAABWUDggGAAAADABAJ0BKgEAAQABABwlpAADcAD+/gbQAA=='; +VueImg$1.canWebp = !![].map && document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0; // Default cdn prefix var protocol = location.protocol === 'https:' ? 'https://' : 'http://'; diff --git a/package.json b/package.json index fc7f8dc..c898bf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-img", - "version": "2.9.1", + "version": "2.10.0", "description": "hash2path wrapper for vue 2", "main": "dist/vue-img.js", "scripts": { diff --git a/src/base.js b/src/base.js index 10d5574..c9c6bf4 100644 --- a/src/base.js +++ b/src/base.js @@ -1,7 +1,7 @@ const VueImg = Object.create(null) // Check webP support -VueImg.canWebp = !![].map && document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0; +VueImg.canWebp = !![].map && document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0 // Default cdn prefix const protocol = location.protocol === 'https:' ? 'https://' : 'http://'