Skip to content

Instantly share code, notes, and snippets.

@sttuartt
Last active June 23, 2025 06:30
Show Gist options
  • Save sttuartt/a4e9682784c5f3920f5cba2c4f434ac7 to your computer and use it in GitHub Desktop.
Save sttuartt/a4e9682784c5f3920f5cba2c4f434ac7 to your computer and use it in GitHub Desktop.
js-endpoints
javascript:(function(){var scripts=document.getElementsByTagName("script"),regex=/(?<=(\"|'|`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|'|`))/g,results=new Set;Promise.all(Array.from(scripts).map(script=>{var src=script.src;if(src){return fetch(src).then(response=>response.text()).then(content=>{var matches=content.matchAll(regex);for(let match of matches){results.add(src+": "+match[0])}}).catch(error=>{console.log("An error occurred: ",error)})}})).then(()=>{var pageContent=document.documentElement.outerHTML,matches=pageContent.matchAll(regex);for(const match of matches){results.add("HTML Content: "+match[0])}writeResults()});function writeResults(){document.open();document.write("<html><body><pre>");results.forEach(result=>{document.write(result+"\n")});document.write("</pre></body></html>");document.close()}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment