mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 17:38:31 +00:00
web/device: add browser type (just chrome for now)
This commit is contained in:
parent
910cbcf236
commit
5fa5a0e7cb
@ -14,6 +14,9 @@ const device = {
|
||||
android: false,
|
||||
mobile: false,
|
||||
},
|
||||
browser: {
|
||||
chrome: false,
|
||||
},
|
||||
prefers: {
|
||||
language: "en",
|
||||
reducedMotion: false,
|
||||
@ -49,6 +52,10 @@ if (browser) {
|
||||
mobile: iOS || android,
|
||||
};
|
||||
|
||||
device.browser = {
|
||||
chrome: ua.includes("chrome/"),
|
||||
};
|
||||
|
||||
device.prefers = {
|
||||
language: navigator.language.toLowerCase().slice(0, 2) || "en",
|
||||
reducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
|
||||
|
Loading…
Reference in New Issue
Block a user