IWBH_01

Find All Network-Hot JavaScript Objects

Apr 29th, 2021 (edited)
522
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.  
  4. //Find All Network-Hot JavaScript Objects
  5.  
  6.  
  7. var getOAPN=function getAllPropertyNames(obj){
  8.  var la=0, lim=700, cu=obj, ALL=[];
  9.  while(lim--&&cu&&(la!=cu)){ try{ ALL=ALL.concat(Object.getOwnPropertyNames(cu)); la=cu; cu=Object.getPrototypeOf(cu); }catch(e){ console.log("property name error, lim= "+lim,e); } }
  10.  return ALL;
  11. };
  12.  
  13.  
  14. var ALL_defo=getOAPN(self);
  15.  
  16.  
  17. var NET_HOT=[],
  18. //using the uri keyword causes problems
  19. net_hot_keywords=[/*"uri",*/"location","domain","origin","href","url","src"],
  20. net_ht_kwL=net_hot_keywords.length,
  21. str, nj=0, //set net j to 0
  22. ki, aw, c0, cn, //cn means current name
  23. ni=ALL_defo.length; //the net that says ni (ALL_defo index)
  24.  
  25. while(ni){
  26.  if(!nj){ ni--;  nj=net_ht_kwL;
  27.   str="\n"+(getOAPN(c0=self[cn=ALL_defo[ni]]).join("\n").toLowerCase());
  28.   try{ if(typeof c0=="function") str+="\n"+(getOAPN(c0.prototype).join("\n").toLowerCase()); }catch(e){ console.log(cn,e); }
  29.  }
  30.  nj--;
  31.  if( (ki=str.indexOf(net_hot_keywords[nj]))+1){
  32.   aw=str.substring(str.lastIndexOf("\n",ki)+1,str.indexOf("\n",ki+1));
  33.   if( (nj!=(net_ht_kwL-1) || aw!="srcelement") && (nj!=(net_ht_kwL-4) || aw.indexOf("original")<0 ) ){
  34.    NET_HOT.push({"name":cn, "keyword":net_hot_keywords[nj], "actual_word":aw });
  35.    nj=0;
  36.   }
  37.  }
  38. }
  39.  
  40.  
  41. //optional sort
  42. //NET_HOT.sort(function(a,b){ return a.name>b.name; });
  43.  
  44.  
  45. //note, still picking up some non-network-related objects, like navigator.geolocation
  46.  
  47.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×