Created
March 9, 2025 17:58
-
-
Save shmick/df4a5b4ac9bb023672a9bf25210cff99 to your computer and use it in GitHub Desktop.
RFD RedFlagDeals Red Flag Deals Dark Mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RFD Dark | |
// @description Dark theme for RFD / RedFlagDeals, powered by the Dark Reader API | |
// @include *://forums.redflagdeals.com/* | |
// @include *://www.redflagdeals.com/* | |
// @run-at document-start | |
// @version 1.2 | |
// ==/UserScript== | |
(function() { | |
function injectScript(fn) { | |
const script = document.createElement("script"); | |
script.textContent = `(${fn})();`; | |
document.documentElement.appendChild(script); | |
} | |
injectScript(() => { | |
// Load DarkReader dynamically | |
const darkReaderScript = document.createElement("script"); | |
darkReaderScript.src = "https://cdn.jsdelivr.net/npm/[email protected]/darkreader.js"; | |
darkReaderScript.onload = () => { | |
DarkReader.setFetchMethod(window.fetch); | |
DarkReader.enable(); | |
setTimeout(() => { | |
DarkReader.enable({ | |
brightness: 100, | |
contrast: 90, | |
sepia: 10 | |
}, { | |
css: `ul.thread-meta-small {background-color: transparent;}`, | |
}); | |
}, 100); | |
}; | |
document.head.appendChild(darkReaderScript); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment