Skip to content

Instantly share code, notes, and snippets.

@ver-1000000
Last active August 14, 2023 05:07
Show Gist options
  • Save ver-1000000/31d3da8090edbd2fc4122baa272037d3 to your computer and use it in GitHub Desktop.
Save ver-1000000/31d3da8090edbd2fc4122baa272037d3 to your computer and use it in GitHub Desktop.
Chromeで任意のMinecraftのDynmapを開いて、ロケーションバーに`javascript:`って打った後にコピペしてエンターするとチャットログが見れる画面が生まれるやつ
d = document; a = d.createElement('pre'); d.body.appendChild(a); a.style = 'position:fixed;resize:both;top:200px;height:200px;width:400px;overflow:auto;white-space:pre-wrap;background:#46486787;z-index:1'; q = (x) => d.querySelectorAll(x)[0]; m = q('.messagelist'); t = ''; o = new MutationObserver(_ => { tt = ((q('.messagerow')||{}).innerText||'').trim(); if (tt && t != tt) { a.innerText = `[${new Date().toLocaleString('ja-JP')}] ${tt}\n\n${a.innerText}`; t = tt; } }); o.observe(m, { childList: true })
d = document;
a = d.createElement('pre');
d.body.appendChild(a);
a.style = 'position:fixed;resize:both;top:200px;height:200px;width:400px;overflow:auto;white-space:pre-wrap;background:#00000080;z-index:1';
q = (x) => d.querySelectorAll(x)[0];
m = q('.messagelist');
t = '';
o = new MutationObserver(_ => {
tt = ((q('.messagerow')||{}).innerText||'').trim();
if (tt && t != tt) {
a.innerText = `[${new Date().toLocaleString('ja-JP')}] ${tt}\n\n${a.innerText}`;
t = tt;
}
});
o.observe(m, { childList: true })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment