Advertisement
IWBH_01

fuwp.html

Jul 27th, 2020
2,357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.82 KB | None | 0 0
  1. <!Doctype html>
  2. <html>
  3. <head>
  4. <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
  5. <title>Fuwp.html</title>
  6. </head>
  7. <body>
  8. This popup winodw or tab is needed for the firefox on TinyCore Linux file upload workaround.
  9. <script type="text/javascript">
  10.  
  11. //this code is part of my "tinycore linux firefox file upload crash workaround improved" system
  12.  
  13. //file browse popup page (fuwp.html)
  14. var lo=self.location.href,qi=lo.indexOf("?"),
  15. aq="&"+lo.substr(qi+1)+"&",
  16. por=aq.substr(aq.indexOf("&or=")),
  17. oor=atob(decodeURIComponent(por.substring(4,por.indexOf("&",4))));
  18.  
  19.  
  20. self.tmpi=document.createElement("iframe");
  21. document.body.appendChild(tmpi);
  22. self.parsDoc=tmpi.contentDocument;
  23. document.body.removeChild(tmpi);
  24.  
  25. self.xhr1=new XMLHttpRequest();
  26. xhr1.onload=function(){
  27.  var so={};
  28.  if(xhr1.responseType=="text"){
  29.   parsDoc.body.innerHTML="";
  30.   parsDoc.open();parsDoc.write(xhr1.response);parsDoc.close();
  31.  
  32.   var fils=parsDoc.getElementsByTagName("tr");
  33.  
  34.   var i=1,L=fils.length,tr,
  35.   fL=[];
  36.   while(i<L){
  37.   tr=fils[i].childNodes;
  38.          // name          ,   type        ,   size        ,   created     ,   modified
  39.   fL.push([tr[0].innerText,tr[1].innerText,tr[2].innerText,tr[3].innerText,tr[4].innerText]);
  40.   i++;
  41.  }
  42.  so.dir=fL;
  43. }else{
  44.  var rL=xhr1.responseURL,ct=xhr1.getResponseHeader("Content-Type");  
  45.  //data, name, mimeType
  46.  so.files=[[xhr1.response,rL.substr(rL.lastIndexOf("/")+1),ct.substr(0,ct.indexOf(";"))]];
  47. }
  48. self.opener.postMessage(so,oor);
  49. };
  50.  
  51.  
  52.  
  53.  
  54. self.addEventListener("message",self.mLs_=function(e){
  55. if(e.source==self.opener){
  56.  var ed=e.data;
  57.  if(ed.do){ xhr1.open('GET',ed.do);
  58.   if(ed.nav){ xhr1.responseType="text"; }
  59.   else if(ed.l0d){ xhr1.responseType="arraybuffer"; }
  60.   xhr1.send();
  61.  }
  62. }
  63. self._LM_=e;
  64. });
  65.  
  66.  
  67.  
  68. </script>
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement