MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / handleFileSelect

Function handleFileSelect

src/options.js:651–670  ·  view source on GitHub ↗
(evt)

Source from the content-addressed store, hash-verified

649 var imp_file = cr('input', i.name, i.id + '_i_file', 'file');
650
651 var handleFileSelect = function (evt) {
652 var files = evt.target.files; // FileList object
653 var data = [];
654
655 var run_impo = function() {
656 impo(data.pop());
657 };
658
659 for (var i = 0, f; f = files[i]; i++) {
660 var reader = new FileReader();
661 // Closure to capture the file information.
662 reader.onload = (function(theFile) {
663 return function(e) {
664 data.push(e.target.result);
665 window.setTimeout(run_impo, 10);
666 };
667 })(f);
668 reader.readAsText(f);
669 }
670 }
671
672 if (!imp_file.inserted) {
673 imp_file.type = 'file';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…