252
edits
Changes
Use MutationObserver to detect when $content is added to the DOM.
/* Any JavaScript here will be loaded for all users on every page load. */
} else {
console.log($content); // delay as wikipage.content is fired before $content is added to the page setTimeout(MathJax.Hub.Queue(["TypesetStill waiting", MathJax.Hub, "wikiPreview"]).execute, 1000); console.log('Found MathJax; typeset done.');
}
}); waitForMathJaxobserver.observe(document, {attributes: false, childList: true, characterData: false, subtree: true});}mw.hook('wikipage.content').add(mathJaxTypeset);