User:Whatkindofausernameisthis/vector-2022.js

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        }); }); }

$(	 => {		const selector = '.vector-toc-list-item button[aria-expanded="false"]';		waitForElm(selector).then( => { const tocItems = document.querySelectorAll(selector); tocItems.forEach(button => button.click); });	} );