getPlatformClass: function()

in media/js/base/site.js [121:173]


        getPlatformClass: function (platform, platformVersion, archSize) {
            var classString = document.documentElement.className;
            var _version = platformVersion ? parseFloat(platformVersion) : 0;

            if (platform === 'windows') {
                // Detect Windows 10 "and up" to display installation
                // messaging on the /firefox/download/thanks/ page.

                if (_version >= 10.0) {
                    classString += ' windows-10-plus';
                }

                // Add fx-unsupported class name for Windows 8.1 and below
                // https://github.com/mozilla/bedrock/issues/13317
                if (_version <= 6.3) {
                    classString += ' fx-unsupported';
                    window.site.fxSupported = false;
                }
            } else {
                classString = classString.replace('windows', platform);
            }

            if (platform === 'osx') {
                // Add fx-unsupported class name for macOS 10.14 and below
                // https://github.com/mozilla/bedrock/issues/13317
                if (_version <= 10.14) {
                    classString += ' fx-unsupported';
                    window.site.fxSupported = false;
                }
            }

            // Used for 64bit download link on Linux and Firefox Beta on Windows.
            if (archSize === 64) {
                classString += ' x64';
            }

            if (window.site.isFirefox()) {
                classString += ' is-firefox';
            }

            // Add class to reflect browsers that get 1st class JS & CSS support.
            var isModernBrowser = (window.site.isModernBrowser =
                window.site.cutsTheMustard());

            if (isModernBrowser) {
                classString += ' is-modern-browser';
            }

            // Add class to reflect javascript availability for CSS
            classString = classString.replace(/\bno-js\b/, 'js');

            return classString;
        },