Skip to content

Instantly share code, notes, and snippets.

@postworthy
Created October 5, 2018 13:53
Show Gist options
  • Save postworthy/05c648ddcac0f6e14dfce8d4f5af82e4 to your computer and use it in GitHub Desktop.
Save postworthy/05c648ddcac0f6e14dfce8d4f5af82e4 to your computer and use it in GitHub Desktop.
var endpointFinder=function(n){var r=new Array,t=function(n,o){if(!i(n)){var e,c=Object.keys(n);for(var f in c){var u=n[c[f]];if(null==u)return;o(u)?(e={Obj:n,Prop:c[f],val:u},r.push(e)):t(u,o)}}},i=function(n){return"string"==typeof n||n instanceof String},o=function(n){return("string"==typeof n||n instanceof String)&&n.length>1&&("/"==n[0]||n.toLowerCase().startsWith("http"))},e=function(n){try{var t=String(n);if(!t.includes("[native code]")&&t.startsWith("function"))return r.some(function(n,r,i){return t.includes(n.Prop)})}catch(n){}return!1},c={findUrls:function(){r=new Array;var n=Object.keys(window);for(var i in n){var e=window[n[i]];try{JSON.stringify(e)&&t(e,o)}catch(n){}}return c},dump:function(n){return console.log("***********************"),n?n(r):console.log(r),console.log("***********************"),c},dumpFunctions:function(){r.forEach(function(n){"function"==typeof n.val&&console.log(n.val)})},findUrlReferences:function(){var n=Object.keys(window);for(var r in n){var i=window[n[r]];try{JSON.stringify(i)&&t(i,e)}catch(n){}}return c}};return c}().findUrls().findUrlReferences().dumpFunctions();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment