forked from aminomancer/uc.css.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathosDetector.uc.js
More file actions
11 lines (10 loc) · 781 Bytes
/
osDetector.uc.js
File metadata and controls
11 lines (10 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
// ==UserScript==
// @name OS Detector
// @version 1.1
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Set an attribute "operatingsystem" on the root element of the chrome window, equal to "win" "linux" or "macosx" so we can more reliably add OS-specific CSS. Firefox doesn't already have something like this because it has OS-specific stylesheets and a build system that creates diverging stylesheets based on Python environment variables or something. But all we have is JavaScript and CSS, so this is the best way to make the theme compatible with other operating systems.
// ==/UserScript==
(function () {
document.documentElement.setAttribute("operatingsystem", AppConstants.platform);
})();