-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webp): Making webp works for story mode
Signed-off-by: Vincent Boutour <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,14 +137,19 @@ | |
|
||
try { | ||
await isWebPCompatible(); | ||
window.dispatchEvent(new Event('thumbnail-done')); | ||
} catch (e) { | ||
resolveScript( | ||
await resolveScript( | ||
'https://unpkg.com/[email protected]/dist-cjs/webp-hero.bundle.js', | ||
'sha512-DA6h9H5Sqn55/uVn4JI4aSPFnAWoCQYYDXUnvjOAMNVx11///hX4QaFbQt5yWsrIm9hSI5fLJYfRWt3KXneSXQ==', | ||
'anonymous', | ||
).then(() => new webpHero.WebpMachine().polyfillDocument()); | ||
); | ||
|
||
const webpMachine = new webpHero.WebpMachine(); | ||
webpMachine.polyfillDocument(); | ||
webpMachine.clearCache(); | ||
} | ||
|
||
window.dispatchEvent(new Event('thumbnail-done')); | ||
}, | ||
false, | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters