This string has no description
0
force_bsky_bg_colour.user.js
24 lines 780 B View raw
1// ==UserScript== 2// @name bluesky: force background colour 3// @description heyy inline + !important ain't very nice :/ 4// @namespace https://kyu.re/~userscripts 5// @match https://*sky.app/* 6// @grant none 7// @run-at document-idle 8// ==/UserScript== 9 10(function() { 11 const TARGET_COLOR = "var(--bg)"; 12 13 function forceBackground() { 14 const html = document.documentElement; 15 if (html.style.getPropertyValue("background") !== TARGET_COLOR) { 16 html.style.setProperty("background", TARGET_COLOR, "important"); 17 } 18 } 19 20 forceBackground(); 21 22 const observer = new MutationObserver(forceBackground); 23 observer.observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class'] }); 24})();
Sign up or login to add to the discussion