From adc43a89e9f4825e3b1545e47463f5787bb241c2 Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Mon, 25 Mar 2019 04:27:43 -0400 Subject: [PATCH] Fix missing FF favicons Closes #683 I think the combo of swapping `window.prefs` for `prefs`, and moving the function inside `onDOMready()` does the trick. @eight04 Any idea why `window.prefs` no longer works? Does the rest LGTY? --- js/dom.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/js/dom.js b/js/dom.js index 86445043..f59c87c2 100644 --- a/js/dom.js +++ b/js/dom.js @@ -68,25 +68,24 @@ onDOMready().then(() => { $.remove('#firefox-transitions-bug-suppressor'); initCollapsibles(); focusAccessibility(); + if (!chrome.app && chrome.windows) { + // add favicon in Firefox + setTimeout(() => { + if (!prefs) { + return; + } + const iconset = ['', 'light/'][prefs.get('iconset')] || ''; + for (const size of [38, 32, 19, 16]) { + document.head.appendChild($create('link', { + rel: 'icon', + href: `/images/icon/${iconset}${size}.png`, + sizes: size + 'x' + size, + })); + } + }); + } }); -if (!chrome.app && chrome.windows) { - // add favicon in Firefox - setTimeout(() => { - if (!window.prefs) { - return; - } - const iconset = ['', 'light/'][prefs.get('iconset')] || ''; - for (const size of [38, 32, 19, 16]) { - document.head.appendChild($create('link', { - rel: 'icon', - href: `/images/icon/${iconset}${size}.png`, - sizes: size + 'x' + size, - })); - } - }); -} - // set language for CSS :lang and [FF-only] hyphenation document.documentElement.setAttribute('lang', chrome.i18n.getUILanguage());