You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

browser.js 899B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module.exports = function arch () {
  2. /**
  3. * User agent strings that indicate a 64-bit OS.
  4. * See: http://stackoverflow.com/a/13709431/292185
  5. */
  6. var userAgent = navigator.userAgent
  7. if ([
  8. 'x86_64',
  9. 'x86-64',
  10. 'Win64',
  11. 'x64;',
  12. 'amd64',
  13. 'AMD64',
  14. 'WOW64',
  15. 'x64_64'
  16. ].some(function (str) {
  17. return userAgent.indexOf(str) > -1
  18. })) {
  19. return 'x64'
  20. }
  21. /**
  22. * Platform strings that indicate a 64-bit OS.
  23. * See: http://stackoverflow.com/a/19883965/292185
  24. */
  25. var platform = navigator.platform
  26. if (platform === 'MacIntel' || platform === 'Linux x86_64') {
  27. return 'x64'
  28. }
  29. /**
  30. * CPU class strings that indicate a 64-bit OS.
  31. * See: http://stackoverflow.com/a/6267019/292185
  32. */
  33. if (navigator.cpuClass === 'x64') {
  34. return 'x64'
  35. }
  36. /**
  37. * If none of the above, assume the architecture is 32-bit.
  38. */
  39. return 'x86'
  40. }