3 ms·
javascript-golf challenge: expose the content of heydonworks.com from the browser console using only javascript.
by g5095 6y ago
javascript-golf challenge: expose the content of heydonworks.com from the browser console using only javascript.
- g5095 6y agocurrently exploring view-source:https://heydonworks.com/ https://heydonworks.com/ by deconstructing the rendered source and injecting the output back into the body..
- danielearwicker 6y agoThis must be the most unnecessarily awkward way of doing it (have to do it from the console after navigating to the site, so the request is allowed). fetch("https://heydonworks.com").then(x => x.text()).then(x => { var f = document.createElement("iframe"); document.body.append(f); f.style.left = "0px"; f.style.top = "0px"; f.style.width = "100%"; f.style.height = "100%"; f.style.position = "absolute"; f.style.border = 0; x = x.replace(/\<\/?noscript\>/gi, ""); x = x.replace(/\<script\>.*\<\/script\>/gi, ""); f.contentDocument.write(x); });