MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / downloadData

Function downloadData

scripts/test.js:580–596  ·  view source on GitHub ↗
(data, filename)

Source from the content-addressed store, hash-verified

578 }
579
580 function downloadData(data, filename) {
581 let file = new Blob([data], { type: "text/plain" });
582 if (window.navigator.msSaveOrOpenBlob) {
583 window.navigator.msSaveOrOpenBlob(file, filename);
584 } else {
585 let a = document.createElement("a"),
586 url = URL.createObjectURL(file);
587 a.href = url;
588 a.download = filename;
589 document.body.appendChild(a);
590 a.click();
591 setTimeout(function () {
592 document.body.removeChild(a);
593 window.URL.revokeObjectURL(url);
594 }, 0);
595 }
596 }
597
598 function wrapGraphQlParams(params) {
599 const formBody = [];

Callers 1

test.jsFile · 0.70

Calls 1

clickMethod · 0.80

Tested by

no test coverage detected