diff --git a/script.user.js b/script.user.js index 1dc2871..7a1e519 100644 --- a/script.user.js +++ b/script.user.js @@ -50,6 +50,33 @@ background: #013e6d !important; .pale, i.pale, .directory_listing_table { color: white !important; opacity: 1; +} +/* Ace editor */ +.ace-tm .ace_gutter { + } `; -document.body.appendChild(style); \ No newline at end of file +function waitForElm(selector) { + return new Promise(resolve => { + if (document.querySelector(selector)) { + return resolve(document.querySelector(selector)); + } + + const observer = new MutationObserver(mutations => { + if (document.querySelector(selector)) { + observer.disconnect(); + resolve(document.querySelector(selector)); + } + }); + + // If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336 + observer.observe(document.body, { + childList: true, + subtree: true + }); + }); +} +document.body.appendChild(style); +waitForElm('.ace_gutter').then((elm) => { + Anywhere.Editor.editor.setOption("theme", "ace/theme/tomorrow_night") +});