Detect Animation only for mediaProxy

Works without, but this should suppress CORS browser errors
This commit is contained in:
David 2022-09-09 04:24:46 -07:00
parent 9f65fef4d5
commit 9d3a32a636

View file

@ -43,11 +43,12 @@ const StillImage = {
this.isAnimated = true this.isAnimated = true
return return
} }
// harmless CORS errors without-- clean console with
if (!this.$store.state.instance.mediaProxyAvailable) return
// Animated JPEGs? // Animated JPEGs?
if (!(this.src.endsWith('.webp') || this.src.endsWith('.png'))) return if (!(this.src.endsWith('.webp') || this.src.endsWith('.png'))) return
// Browser Cache should ensure image doesn't get loaded twice if cache exists // Browser Cache should ensure image doesn't get loaded twice if cache exists
fetch(image.src, { fetch(image.src, {
mode: 'cors',
referrerPolicy: 'same-origin' referrerPolicy: 'same-origin'
}) })
.then(data => { .then(data => {