window.navigator All In One
window.navigator All In One
navigator
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2020-11-11
* @modified
*
* @description
* @difficulty Easy Medium Hard
* @complexity O(n)
* @augments
* @example
* @link
* @solutions
*
* @best_solutions
*
*/
const log = console.log;
if(window.navigator) {
log(`window.navigator =`, navigator)
}
for(const item in navigator) {
// log(`navigator.${item} =`, item);
// log(`navigator.${item} =`, item, typeof item);
log(`navigator.${item} =`, item, navigator[item]);
}
// navigator.vendorSub = vendorSub
// navigator.productSub = productSub
// navigator.vendor = vendor
// navigator.maxTouchPoints = maxTouchPoints
// navigator.userActivation = userActivation
// navigator.doNotTrack = doNotTrack
// navigator.geolocation = geolocation
// navigator.connection = connection
// navigator.plugins = plugins
// navigator.mimeTypes = mimeTypes
// navigator.webkitTemporaryStorage = webkitTemporaryStorage
// navigator.webkitPersistentStorage = webkitPersistentStorage
// navigator.hardwareConcurrency = hardwareConcurrency
// navigator.cookieEnabled = cookieEnabled
// navigator.appCodeName = appCodeName
// navigator.appName = appName
// navigator.appVersion = appVersion
// navigator.platform = platform
// navigator.product = product
// navigator.userAgent = userAgent
// navigator.language = language
// navigator.languages = languages
// navigator.onLine = onLine
// navigator.getBattery = getBattery
// navigator.getGamepads = getGamepads
// navigator.javaEnabled = javaEnabled
// navigator.sendBeacon = sendBeacon
// navigator.vibrate = vibrate
// navigator.scheduling = scheduling
// navigator.xr = xr
// navigator.mediaCapabilities = mediaCapabilities
// navigator.permissions = permissions
// navigator.locks = locks
// navigator.wakeLock = wakeLock
// navigator.usb = usb
// navigator.mediaSession = mediaSession
// navigator.clipboard = clipboard
// navigator.credentials = credentials
// navigator.keyboard = keyboard
// navigator.mediaDevices = mediaDevices
// navigator.storage = storage
// navigator.serviceWorker = serviceWorker
// navigator.deviceMemory = deviceMemory
// navigator.presentation = presentation
// navigator.bluetooth = bluetooth
// navigator.registerProtocolHandler = registerProtocolHandler
// navigator.unregisterProtocolHandler = unregisterProtocolHandler
// navigator.getInstalledRelatedApps = getInstalledRelatedApps
// navigator.clearAppBadge = clearAppBadge
// navigator.setAppBadge = setAppBadge
// navigator.getUserMedia = getUserMedia
// navigator.requestMIDIAccess = requestMIDIAccess
// navigator.requestMediaKeySystemAccess = requestMediaKeySystemAccess
// navigator.webkitGetUserMedia = webkitGetUserMedia
导航器界面表示用户代理的状态和身份。它允许脚本查询并注册自己以进行一些活动。
https://developer.mozilla.org/en-US/docs/Web/API/Navigator
多点触控检测
navigator.maxTouchPoints
const log = console.log;
const touchPoints = navigator.maxTouchPoints;
if (touchPoints > 1) {
log(`✅ your browser supports multi-touch`)
} else {
log(`❌ your browser not supports multi-touch`)
}
https://www.w3.org/TR/pointerevents2/#extensions-to-the-navigator-interface
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints
refs
UA
https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13966715.html
未经授权禁止转载,违者必究!