1function BlazorDownloadFile(filename, contentType, content) { 2 // Create the URL 3 const file = new File([content], filename, { type: contentType }); 4 const exportUrl = URL.createObjectURL(file); 5 6 // Create the <a> element and click on it 7 const a = document.createElement("a"); 8 document.body.appendChild(a); 9 a.href = exportUrl; 10 a.download = filename; 11 a.target = "_self"; 12 a.click(); 13 14 // We don't need to keep the object URL, let's release the memory 15 // On older versions of Safari, it seems you need to comment this line... 16 URL.revokeObjectURL(exportUrl); 17} 18 19 20function BlazorCopyToClipboard(text) { 21 // modern API 22 if (navigator.clipboard && window.isSecureContext) { 23 navigator.clipboard.writeText(text); 24 return; 25 } 26 27 // fallback (legacy) 28 const textarea = document.createElement("textarea"); 29 textarea.value = text; 30 31 textarea.style.position = "fixed"; 32 textarea.style.left = "-999999px"; 33 textarea.style.top = "-999999px"; 34 35 document.body.appendChild(textarea); 36 textarea.focus(); 37 textarea.select(); 38 39 try { 40 document.execCommand("copy"); 41 } catch (err) { 42 console.error("Copy failed", err); 43 } 44 45 document.body.removeChild(textarea); 46} 47 48 49 50async function BlazorDownloadFileFromStream(filename, contentType, contentStreamReference) { 51 // Îιαβάζει Ïο .NET stream (DotNetStreamReference) ÏÏ ArrayBuffer 52 const arrayBuffer = await contentStreamReference.arrayBuffer(); 53 const blob = new Blob([arrayBuffer], { type: contentType }); 54 const url = URL.createObjectURL(blob); 55 56 const a = document.createElement("a"); 57 document.body.appendChild(a); 58 a.href = url; 59 a.download = filename; 60 a.target = "_self"; 61 a.click(); 62 a.remove(); 63 64 URL.revokeObjectURL(url); 65}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.