Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!Doctype html>
- <html>
- <head>
- <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
- <title>Fuwp.html</title>
- </head>
- <body>
- This popup winodw or tab is needed for the firefox on TinyCore Linux file upload workaround.
- <script type="text/javascript">
- //this code is part of my "tinycore linux firefox file upload crash workaround improved" system
- //file browse popup page (fuwp.html)
- var lo=self.location.href,qi=lo.indexOf("?"),
- aq="&"+lo.substr(qi+1)+"&",
- por=aq.substr(aq.indexOf("&or=")),
- oor=atob(decodeURIComponent(por.substring(4,por.indexOf("&",4))));
- self.tmpi=document.createElement("iframe");
- document.body.appendChild(tmpi);
- self.parsDoc=tmpi.contentDocument;
- document.body.removeChild(tmpi);
- self.xhr1=new XMLHttpRequest();
- xhr1.onload=function(){
- var so={};
- if(xhr1.responseType=="text"){
- parsDoc.body.innerHTML="";
- parsDoc.open();parsDoc.write(xhr1.response);parsDoc.close();
- var fils=parsDoc.getElementsByTagName("tr");
- var i=1,L=fils.length,tr,
- fL=[];
- while(i<L){
- tr=fils[i].childNodes;
- // name , type , size , created , modified
- fL.push([tr[0].innerText,tr[1].innerText,tr[2].innerText,tr[3].innerText,tr[4].innerText]);
- i++;
- }
- so.dir=fL;
- }else{
- var rL=xhr1.responseURL,ct=xhr1.getResponseHeader("Content-Type");
- //data, name, mimeType
- so.files=[[xhr1.response,rL.substr(rL.lastIndexOf("/")+1),ct.substr(0,ct.indexOf(";"))]];
- }
- self.opener.postMessage(so,oor);
- };
- self.addEventListener("message",self.mLs_=function(e){
- if(e.source==self.opener){
- var ed=e.data;
- if(ed.do){ xhr1.open('GET',ed.do);
- if(ed.nav){ xhr1.responseType="text"; }
- else if(ed.l0d){ xhr1.responseType="arraybuffer"; }
- xhr1.send();
- }
- }
- self._LM_=e;
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement