Questions tagged [platform-detection]

For questions specific to finding out about the platform operated by the client software. For platform detection based on library usage, use the specific library or framework tag instead.

Programs which comes with platform detection features can be useful for completing independent user interfaces for specific platforms, for example, between mobile and Mac. Some programming language also enables the programmer to write "System check code" which relies on the inconsistencies of operations across platforms even if the code is the same.

14 questions
1275
votes
46 answers

Detecting a mobile browser

I'm looking for a function that returns a boolean value if the user is using a mobile browser or not. I know that I can use navigator.userAgent and write that function by using regex, but user-agents are too various for different platforms. I doubt…
ave
  • 18,083
  • 9
  • 30
  • 39
295
votes
31 answers

How to detect Windows 64-bit platform with .NET?

In a .NET 2.0 C# application I use the following code to detect the operating system platform: string os_platform = System.Environment.OSVersion.Platform.ToString(); This returns "Win32NT". The problem is that it returns "Win32NT" even when running…
Marc
  • 9,012
  • 13
  • 57
  • 72
154
votes
5 answers

Detecting Windows or Linux?

I am seeking to run a common Java program in both Windows and Linux. The program needs to do some things differently on each platform. So how can / should my Java program detect it is running under Linux vs. Windows?
Ron Whites
  • 1,721
  • 3
  • 12
  • 8
68
votes
6 answers

Reliably detect Windows in Python

I'm working on a couple of Linux tools and need to prevent installation on Windows, since it depends on FHS and is thus rendered useless on that platform. The platform.platform function comes close but only returns a string. Unfortunately I don't…
blokkie
  • 5,375
  • 7
  • 24
  • 18
32
votes
2 answers

Detecting the platform (Window or Linux) by Groovy/Grails

Is there a way to detect the platform (Window / Linux) in which the website is running by Groovy / Grails?
Hoàng Long
  • 10,746
  • 20
  • 75
  • 124
15
votes
1 answer

Detect different device platforms using CSS

I'd like to say that I have read and tried many variations of the instructions here: http://www.cloudfour.com/ipad-css/ Detect iPhone/iPad purely by css Detect Xoom browser…
Matt W
  • 11,753
  • 25
  • 118
  • 215
3
votes
1 answer

How to detect Linux or macOS or Windows in powershell?

I use uname -s in bash scripts to determine the OS and it returns Linux, Darwin or MINGW64_NT... when its running on Linux, macOS or Windows. EDIT0 : I want my $PROFILE script to detect the OS whether is running on Windows with PS (version could be…
SebMa
  • 4,037
  • 29
  • 39
2
votes
0 answers

Automatically convert Mac file path to PC file path

I want to create a script that will always run in Windows Explorer that will take a Mac OS X path and convert it to a Windows path automatically. So if I receive a Mac path and am working on Windows I can copy the Mac file path into Explorer and it…
1
vote
1 answer

Adafruit-PlatformDetect unable to detect board

Im trying to import board on a feather m4 expressx and getting the following error. Ive run the command it promoted me to do below and nothing changed. All libraries and software is updated. Im still getting the following error …
1
vote
1 answer

How can I check whether an ISA extension is supported by current ARM CPU?

When a userspace program on x86 needs to determine whether e.g. AVX extension is supported, it can use CPUID instruction. Is there any similarly OS-independent way to check support for an ISA extension (e.g. NEON) in ARM?
Ruslan
  • 18,162
  • 8
  • 67
  • 136
1
vote
1 answer

How to detect a smartphone through JavaScript/CSS?

I've seen around the web that the best way to make a responsive design is to use CSS @media queries. This does not seem like a practical solution as many phones identify as screen and have as many pixels as desktop monitors (i.e. the iPhone 6 Plus…
Sam Crater
  • 13
  • 3
1
vote
2 answers

Padding different in chrome mac vs firefox and chrome pc

I'm trying to align the navigation to the banner below on the website I'm creating here: http://35.9.51.41 I've been able to make it so it aligns in Chrome and Safari on my mac, and in IE, but it is still misaligned on Firefox or any PC using Chrome…
0
votes
1 answer

Browser: How to give a different default app download URL for Linux, macOS and Windows platforms?

I have a need to provide a default application download URL in my primary site call to action (CTA) link for Windows, macOS and Linux. In my case this is for an application built using electron-builder, though I'd also be curious in a general…
pzrq
  • 1,626
  • 1
  • 18
  • 24
0
votes
1 answer

Code / Ascii function in VBA Excel on MAC vs on PC

On a PC I have these chars with their ASCii code 178,188,189 respectively. But when I use the CODE function on MAC VBA Excel I always get 95 for all three different chars. char PC MAC ² 178 95 ½ 188 95 ¾ 189 95 How can I…
user387184
  • 10,953
  • 12
  • 77
  • 147