tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fonts.js (472B)


      1 function loadAllFonts() {
      2  // Use this to wait for all fonts in a testcase to load rather than just using
      3  // `document.fonts.ready.then(...)` in the load event, since there are compat
      4  // issues between browsers as to whether content initiated font loads are
      5  // guaranteed to have been started by this point.
      6 
      7  // FIXME: Use Promise.all() to cause an obvious failure when a font fails to load.
      8  return Promise.allSettled([...document.fonts].map(f => f.load()));
      9 }