Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. {
  2. "content_scripts": [
  3. {
  4. "matches": ["http://exifdata.com/"], // sample site
  5. "js": ["index.js"]
  6. }
  7. ],
  8. "manifest_version": 2,
  9. "name": "Test",
  10. "version": "0.0.0"
  11. }
  12.  
  13. function fileToDataView(file) {
  14. var reader = new FileReader();
  15. reader.onload = function (e) {
  16. console.log(new DataView(e.target.result));
  17. };
  18. reader.onerror = function (error) {
  19. console.log(error); // no error occurs
  20. };
  21. reader.readAsArrayBuffer(file);
  22. }
  23.  
  24. var nodes = document.querySelectorAll('input[type=file]')
  25.  
  26. nodes.forEach(function (node) {
  27. node.onchange = function (event) {
  28. fileToDataView(event.target.files[0]);
  29. }
  30. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement