From 78162e6d2692c1c68751b699d7edec5a1b9b53d4 Mon Sep 17 00:00:00 2001 From: bcoles Date: Sun, 3 Feb 2013 03:01:54 +1030 Subject: [PATCH] Add 'beef.hardware.cpuType()' --- core/main/client/hardware.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/core/main/client/hardware.js b/core/main/client/hardware.js index dc9ae7a4c..b5bfa1d4c 100644 --- a/core/main/client/hardware.js +++ b/core/main/client/hardware.js @@ -8,10 +8,27 @@ beef.hardware = { ua: navigator.userAgent, + cpuType: function() { + // IE + if ((typeof navigator.cpuClass != 'undefined')) { + cpu = navigator.cpuClass; + if (cpu == "x86") return "32-bit"; + if (cpu == "68K") return "Motorola 68K": + if (cpu == "PPC") return "Motorola PPC"; + if (cpu == "Alpha") return "Digital"; + if (this.ua.match('Win64; IA64') return "64-bit (Intel)"; + if (this.ua.match('Win64; x64') return "64-bit (AMD)"; + // Firefox + } else if ((typeof navigator.oscpu != 'undefined' { + if (navigator.oscpu.match('WOW64|x64|x86_64)') return "64-bit"; + } + if (navigator.platform.toLowerCase() == "win64") return "64-bit" + return "32-bit"; + }, + isVirtualMachine: function() { - var result = false; - if (screen.width % 2 || screen.height % 2) result = true; - return result; + if (screen.width % 2 || screen.height % 2) return true; + return false; }, isNokia: function() {