ページ内のテキストを全部消す.js
code:script.js
javascript:(()=>{Array.from(document.querySelectorAll("body *")).map(e=>Array.from(e.childNodes).filter(e=>e instanceof Text)).flat().forEach(e=>e.data="");Array.from(document.querySelectorAll(":is(input, textarea)")).forEach(e=>e.placeholder=e.value="");return;})()
コード
code:script.js
Array.from(document.querySelectorAll("body *")).map(el => Array.from(el.childNodes).filter(el => el instanceof Text)).flat().forEach(el => el.data = "");
Array.from(document.querySelectorAll(":is(input, textarea)")).forEach(el => el.placeholder = el.value = "");
解説
ノードの方のTextが保持している文字列は、CharacterData.data(MDN Web Docs)で読み書きできます Text.dataだと思ったら継承元クラスのCharacterDataの方だった
inputとtextareaのvalueやプレースホルダーも消します