SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function toDataURL(url, callback) {
  2.   var xhr = new XMLHttpRequest();
  3.     xhr.onload = function() {
  4.         var reader = new FileReader();
  5.             reader.onloadend = function() {
  6.                   callback(reader.result);
  7.                       }
  8.                           reader.readAsDataURL(xhr.response);
  9.                             };
  10.                               xhr.open('GET', url);
  11.                                 xhr.responseType = 'blob';
  12.                                   xhr.send();
  13.                                   }
  14.  
  15. toDataURL('file:///app/main.py', function(dataUrl) {
  16.      document.write('RESULT:',atob(dataUrl.split(",")[1]))
  17. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top