WebP image support for Firefox

This commit is contained in:
2019-03-26 15:06:15 +09:00
parent 2fe456b5db
commit 722faa81ce
5 changed files with 16 additions and 9 deletions

View File

@ -12,7 +12,7 @@ import InfiniteScroller from "./InfiniteScroller"
import ServiceWorkerManager from "./ServiceWorkerManager"
import ServerEvents from "./ServerEvents"
import { displayAiringDate, displayDate, displayTime } from "./DateView"
import { findAll, canUseWebP, requestIdleCallback, swapElements, delay, findAllInside } from "./Utils"
import { findAll, supportsWebP, requestIdleCallback, swapElements, delay, findAllInside } from "./Utils"
import * as actions from "./Actions"
export default class AnimeNotifier {
@ -106,10 +106,7 @@ export default class AnimeNotifier {
this.run()
}
run() {
// Check for WebP support
this.webpEnabled = canUseWebP()
async run() {
// Initiate the elements we need
this.user = document.getElementById("user")
this.app.content = document.getElementById("content")
@ -151,6 +148,9 @@ export default class AnimeNotifier {
// Infinite scrolling
this.infiniteScroller = new InfiniteScroller(this.app.content.parentElement, 150)
// WebP
this.webpEnabled = await supportsWebP()
// Loading
this.loading(false)
}