Path: blob/trunk/third_party/closure/goog/labs/useragent/extra.js
4122 views
/**1* @license2* Copyright The Closure Library Authors.3* SPDX-License-Identifier: Apache-2.04*/56/**7* @fileoverview Provides extra checks for user agent that are not reflected in8* the standard user agent checks. This includes runtime heuristics to determine9* the true environment on browsers that present a different user agent to10* appear to be running in a different environment.11*/1213goog.module('goog.labs.userAgent.extra');1415const platform = goog.require('goog.labs.userAgent.platform');1617/**18* Checks whether the browser appears to be a desktop-class running on a mobile19* device. Starting with iPadOS 13 this is the default for non-mini iPads20* running at >=2/3 of the screen. The user agent is otherwise indistinguishable21* from Mac Safari. The user can also force desktop on other devices. This logic22* previously also checked for Safari, however other iOS browsers have since23* adopted the same behavior.24*25* @return {boolean} Whether the runtime heuristics thinks this is Desktop26* Safari on a non-desktop device.27*/28function isSafariDesktopOnMobile() {29return platform.isMacintosh() && goog.global.navigator.maxTouchPoints > 0;30}3132exports = {isSafariDesktopOnMobile};333435