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

Function download

scripts/backup/fb-save-exporter.js:13–28  ·  view source on GitHub ↗
(e, a, t)

Source from the content-addressed store, hash-verified

11 );
12 },
13 download = (e, a, t) => {
14 var s = new Blob([e], { type: t });
15 if (window.navigator.msSaveOrOpenBlob)
16 window.navigator.msSaveOrOpenBlob(s, a);
17 else {
18 var i = document.createElement("a"),
19 n = URL.createObjectURL(s);
20 (i.href = n),
21 (i.download = a),
22 document.body.appendChild(i),
23 i.click(),
24 setTimeout(function () {
25 document.body.removeChild(i), window.URL.revokeObjectURL(n);
26 }, 0);
27 }
28 },
29 encodeHTML = (e) =>
30 e.replace(/([\u00A0-\u9999<>&])(.|$)/g, function (e, a, t) {
31 return "&" !== a || "#" !== t

Callers 1

templateFunction · 0.70

Calls 1

clickMethod · 0.80

Tested by

no test coverage detected