mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe
synced 2025-05-01 03:19:29 +08:00
Detect Animation only for mediaProxy
Works without, but this should suppress CORS browser errors
This commit is contained in:
parent
9f65fef4d5
commit
9d3a32a636
1 changed files with 2 additions and 1 deletions
|
@ -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 => {
|
||||||
|
|
Loading…
Reference in a new issue