MCPcopy
hub / github.com/zxlie/FeHelper / downloadFile

Function downloadFile

apps/page-monkey/index.js:563–571  ·  view source on GitHub ↗
(text, filename, type)

Source from the content-addressed store, hash-verified

561 },
562
563 downloadFile(text, filename, type) {
564 let blob = new Blob([text], { type: type || 'application/octet-stream' });
565 let a = document.createElement('a');
566 a.href = URL.createObjectURL(blob);
567 a.download = filename;
568 document.body.appendChild(a);
569 a.click();
570 setTimeout(() => { URL.revokeObjectURL(a.href); a.remove(); }, 1000);
571 },
572
573 importFromFile() {
574 this.pickFile(['.user.js', '.js', '.json'], (file, text) => {

Callers

nothing calls this directly

Calls 2

setTimeoutFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected