Advertisement
IWBH_01

linux tinycore plus firefox upload crash patch

Jun 24th, 2020 (edited)
1,374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. self.xhr1=new XMLHttpRequest();
  2.  
  3. xhr1.open("GET","http://127.0.0.1:120/path/to/file.txt");
  4. xhr1.responseType="arraybuffer";
  5.  
  6.  
  7. xhr1.onload=function(){
  8. self.fi1_=new File([xhr1.response],"file.txt",{"type":"text/plain"});
  9. gfile(0,fi1_);
  10.  
  11. }
  12.  
  13. xhr1.send();
  14.  
  15.  
  16. /*
  17. weakmap all input[type=file] elements to regualar arrays replaceing their FileList arrays
  18. change the FileList.prototype.item with defineGetter and replace inputElement.files with a regular js array
  19. of the files fetched with xhr1;
  20.  
  21. make popup window for the open file dialog window? with location.href set to http://127.0.0.1:120/
  22. make xhr request each file selected and add xhr responses as File() objects to the files[] array.
  23. finnally, create and fire a "change" event on the file input htmlelement
  24. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement