If you're feeling brave, could look into using https://github.com/guardian/frontend/blob/e890999b1119bced7b13064f5b244c7ad2c140ea/common/app/assets/javascripts/modules/detect.js#L255