zoukankan      html  css  js  c++  java
  • xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

    window.navigator All In One

    "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 发布文章使用:只允许注册用户才可以访问!


  • 相关阅读:
    【排序】SelectSort
    Linux下程序的Profile工具
    Ubuntu adb devices :???????????? no permissions 解决方法
    利用宏控制打印
    关于错误 Resource temporarily unavailable
    如何不使用pthread_cancel而杀死线程
    【排序】BubbleSort
    使用 autotools 生成包含多文件的 Makefile
    source命令使用
    2010 成都预选赛 Binary Number
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/13966715.html
Copyright © 2011-2022 走看看