feat: badge DOM manipulation with MutationObservers and dark mode detection
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user