Skip to content

Instantly share code, notes, and snippets.

@herbaldrinkmate
Last active November 22, 2025 05:55
  • Select an option

Select an option

// ==UserScript==
// @name Fix Selection Background in Dark Theme on Greasy Fork for Firefox on Android
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Changes the text selection background color in Dark Theme on Firefox for Android to the same color as Chrome.
// @match https://greasyfork.org/*
// @grant GM_addStyle
// @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @run-at document-start
// @license MIT
// ==/UserScript==
(function() {
'use strict';
const isDarkModePreferred = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (isDarkModePreferred) {
const css = `
::selection {
background-color: #336298 !important;
}
::-moz-selection {
background-color: #336298 !important;
}
`;
GM_addStyle(css);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment