mirror of
https://github.com/wukko/cobalt.git
synced 2025-02-27 05:28:49 +01:00
web/device: add browser type (just chrome for now)
This commit is contained in:
parent
910cbcf236
commit
5fa5a0e7cb
1 changed files with 7 additions and 0 deletions
|
@ -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 a new issue