October 22, 2024
Chicago 12, Melborne City, USA
CSS

How to detect Linux/Windows operating system in CSS in Firefox userChrome.css & userContent.css?


For Firefox’s userChrome.css and userContent.css files (thus no JavaScript available), how can we detect on which operating system the Firefox web browser is running? At the least, we need to differentiate between Linux and Windows; also recognizing macOS is a bonus, but not required.

I thought there was a way to accomplish this using @media queries, but I’m not seeing a documented way to use @media at-rules to get the job done.

Please note that this only needs to work in Firefox; cross-browser functionality is not needed (and thus the cross-browser questions with answers that state there is no way are not applicable, as perhaps there is now a way to accomplish this in Firefox specifically).



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video