xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

how to get the platform of user's browser in js All In One

how to get the platform of user's browser in js All In One

如何使用 js 获取用户浏览器平台的方法

navigator;
/*
Navigator {vendorSub: '', productSub: '20030107', vendor: 'Google Inc.', maxTouchPoints: 0, scheduling: Scheduling, …}
appCodeName
: 
"Mozilla"
appName
: 
"Netscape"
appVersion
: 
"5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
bluetooth
: 
Bluetooth {}
clipboard
: 
Clipboard {}
connection
: 
NetworkInformation {onchange: null, effectiveType: '4g', rtt: 200, downlink: 3.4, saveData: false}
cookieEnabled
: 
true
credentials
: 
CredentialsContainer {}
deviceMemory
: 
8
doNotTrack
: 
"1"
geolocation
: 
Geolocation {}
hardwareConcurrency
: 
12
hid
: 
HID {onconnect: null, ondisconnect: null}
ink
: 
Ink {}
keyboard
: 
Keyboard {}
language
: 
"zh-CN"
languages
: 
(5) ['zh-CN', 'zh', 'en-US', 'en', 'ko']
locks
: 
LockManager {}
managed
: 
NavigatorManagedData {onmanagedconfigurationchange: null}
maxTouchPoints
: 
0
mediaCapabilities
: 
MediaCapabilities {}
mediaDevices
: 
MediaDevices {ondevicechange: null}
mediaSession
: 
MediaSession {metadata: null, playbackState: 'none'}
mimeTypes
: 
MimeTypeArray {0: MimeType, 1: MimeType, application/pdf: MimeType, text/pdf: MimeType, length: 2}
onLine
: 
true
pdfViewerEnabled
: 
true
permissions
: 
Permissions {}
platform
: 
"MacIntel"
plugins
: 
PluginArray {0: Plugin, 1: Plugin, 2: Plugin, 3: Plugin, 4: Plugin, PDF Viewer: Plugin, Chrome PDF Viewer: Plugin, Chromium PDF Viewer: Plugin, Microsoft Edge PDF Viewer: Plugin, WebKit built-in PDF: Plugin, …}
presentation
: 
Presentation {defaultRequest: null, receiver: null}
product
: 
"Gecko"
productSub
: 
"20030107"
scheduling
: 
Scheduling {}
serial
: 
Serial {onconnect: null, ondisconnect: null}
serviceWorker
: 
ServiceWorkerContainer {controller: null, ready: Promise, oncontrollerchange: null, onmessage: null, onmessageerror: null}
storage
: 
StorageManager {}
usb
: 
USB {onconnect: null, ondisconnect: null}
userActivation
: 
UserActivation {hasBeenActive: true, isActive: true}
userAgent
: 
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
userAgentData
: 
NavigatorUAData {brands: Array(3), mobile: false, platform: 'macOS'}
vendor
: 
"Google Inc."
vendorSub
: 
""
virtualKeyboard
: 
VirtualKeyboard {boundingRect: DOMRect, overlaysContent: false, ongeometrychange: null}
wakeLock
: 
WakeLock {}
webdriver
: 
false
webkitPersistentStorage
: 
DeprecatedStorageQuota {}
webkitTemporaryStorage
: 
DeprecatedStorageQuota {}
windowControlsOverlay
: 
WindowControlsOverlay {visible: false, ongeometrychange: null}
xr
: 
XRSystem {ondevicechange: null}
[[Prototype]]
: 
Navigator
*/ 
navigator.platform;
// 'MacIntel'

demos

download file's extension auto match

image

https://www.jetbrains.com/pycharm/

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-02-15 10:36  xgqfrms  阅读(17)  评论(0编辑  收藏  举报