Skip to content

Commit

Permalink
[submodule:helpers] Revert providing extra param in `isAppleSilicon()…
Browse files Browse the repository at this point in the history
…` and just check for window instead
  • Loading branch information
faisalman committed Nov 16, 2024
1 parent 2b125c8 commit b1c7dfc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/ua-parser-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 isAppleSilicon = (res, useFeatureDetection) => {
const isAppleSilicon = (res) => {
if (res.os.is(OS.MACOS)) {
if (res.cpu.is(CPU.ARM)) {
return true;
}
if (useFeatureDetection) {
if (typeof window !== 'undefined') {
try {
const canvas = document.createElement('canvas');
const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
Expand Down

0 comments on commit b1c7dfc

Please sign in to comment.