Detect Firefox in Favico.js based on CSS
authorAlexander Ebert <ebert@woltlab.com>
Mon, 4 Apr 2022 17:08:41 +0000 (19:08 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 4 Apr 2022 17:08:41 +0000 (19:08 +0200)
See https://www.woltlab.com/community/thread/294994-verwendung-von-installtrigger-in-favico-js-vermeiden/

wcfsetup/install/files/js/3rdParty/favico.js

index 0df45b44097d87765c8afb0db0aa8c7497e8d8fc..0318c933548113c3da8012d52cb8d6ee27fac984 100644 (file)
@@ -46,7 +46,7 @@
                var _opt, _orig, _h, _w, _canvas, _context, _img, _ready, _lastBadge, _running, _readyCb, _stop, _browser, _animTimeout, _drawTimeout, _doc;
 
                _browser = {};
-               _browser.ff = typeof InstallTrigger != 'undefined';
+               _browser.ff = Array.from(window.getComputedStyle(document.documentElement)).some((propertyName) => propertyName.indexOf("-moz-") === 0);
                _browser.chrome = !!window.chrome;
                _browser.opera = !!window.opera || navigator.userAgent.indexOf('Opera') >= 0;
                _browser.ie = /*@cc_on!@*/false;