feat: badge DOM manipulation with MutationObservers and dark mode detection

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-26 15:00:49 -04:00
parent 5d2a4afc98
commit 6cedae7a2c
2 changed files with 180 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
(function () {
"use strict";
async function init() {
const settings = await window.RedditTweaks.loadSettings();
if (!settings.enabled) return;
window.RedditTweaks.badgeTweak.apply(settings);
browser.storage.onChanged.addListener(function (changes) {
if (changes.enabled) {
location.reload();
return;
}
window.RedditTweaks.loadSettings().then(function (updated) {
window.RedditTweaks.badgeTweak.updateColors(updated);
});
});
}
init();
})();