Here’s a funny coincidence… I’m like 90% sure this other post on the front page of r/baduk is using some code I wrote to customize stones: https://www.reddit.com/r/baduk/comments/ssxkxb/ogs_theme_hikaru/
}
blah = document.getElementById("board-canvas")
console.log(blah)
for (let i = 0; i < BRUTE; i++) blah.dispatchEvent(new Event('resize'))
}
// set up the mutation observer
// altho this should be installed with @run-at idle, I still saw the code run prior to these globals being available, so just watch the page for updates until they are present
var observer = new MutationObserver(function (mutations, me) {
if (typeof data !== "undefined" && typeof GoThemes !== "undefined") {
setup();
setTimeout(clickCrazy, 1000)
me.disconnect(); // stop observing
} else {
console.log("[ogs hikaru] data or GoThemes not found, waiting...");
}
});
edit: yeah, actually they even credit me in the header. I should send a PR though, I think they are doing some unnecessarily goofy stuff to redraw OGS’s goban
4 Likes