zlacker

[parent] [thread] 2 comments
1. g5095+(OP)[view] [source] 2020-11-29 06:14:36
javascript-golf challenge: expose the content of heydonworks.com from the browser console using only javascript.
replies(2): >>g5095+8 >>daniel+Xb3
2. g5095+8[view] [source] 2020-11-29 06:16:31
>>g5095+(OP)
currently exploring view-source:https://heydonworks.com/ by deconstructing the rendered source and injecting the output back into the body..
3. daniel+Xb3[view] [source] 2020-11-30 16:34:00
>>g5095+(OP)
This 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); 
    });
[go to top]