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
// Load fonts async by default | |
// Load sync from SW cache when available. | |
// | |
// Snippet assumes your Service Worker caches fonts as part of installation, so that | |
// an 'activated' Service Worker means the fonts are cached with 100% confidence. | |
if ( | |
'serviceWorker' in navigator && | |
navigator.serviceWorker.controller !== null && | |
navigator.serviceWorker.controller.state === 'activated' | |
) { |