mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-28 00:18:45 +03:00
[submodule:helpers] Revert providing extra param in isAppleSilicon()
and just check for window instead
This commit is contained in:
parent
2b125c8de4
commit
b1c7dfcc3a
@ -15,12 +15,12 @@ const { isStandalonePWA } = require('is-standalone-pwa');
|
|||||||
|
|
||||||
const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor;
|
const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor;
|
||||||
|
|
||||||
const isAppleSilicon = (res, useFeatureDetection) => {
|
const isAppleSilicon = (res) => {
|
||||||
if (res.os.is(OS.MACOS)) {
|
if (res.os.is(OS.MACOS)) {
|
||||||
if (res.cpu.is(CPU.ARM)) {
|
if (res.cpu.is(CPU.ARM)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (useFeatureDetection) {
|
if (typeof window !== 'undefined') {
|
||||||
try {
|
try {
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user