Skip to content

Instantly share code, notes, and snippets.

@thevillagehacker
Created August 7, 2023 03:12
Show Gist options
  • Save thevillagehacker/76b78a1fe00c40e0923afa2fd9fabef1 to your computer and use it in GitHub Desktop.
Save thevillagehacker/76b78a1fe00c40e0923afa2fd9fabef1 to your computer and use it in GitHub Desktop.

Revisions

  1. thevillagehacker created this gist Aug 7, 2023.
    1 change: 1 addition & 0 deletions extract.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    javascript:(function(){var scripts=document.getElementsByTagName("script"),regex=/(?<=(\"|\'|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\`))/g;const results=new Set;for(var i=0;i<scripts.length;i++){var t=scripts[i].src;""!=t&&fetch(t).then(function(t){return t.text()}).then(function(t){var e=t.matchAll(regex);for(let r of e)results.add(r[0])}).catch(function(t){console.log("An error occurred: ",t)})}var pageContent=document.documentElement.outerHTML,matches=pageContent.matchAll(regex);for(const match of matches)results.add(match[0]);function writeResults(){results.forEach(function(t){document.write(t+"<br>")})}setTimeout(writeResults,3e3);})();