Download test-excel-fix.html from bep40/V.AISTUDIO: direct link, hf CLI and curl.
- Browser
- Download file 2.12 kB
-
https://huggingface.co/bep40/V.AISTUDIO/resolve/refs%2Fpr%2F13/test-excel-fix.html
- Command line
-
hf download hf://bep40/V.AISTUDIO@refs/pr/13/test-excel-fix.html
-
curl -L -o test-excel-fix.html https://huggingface.co/bep40/V.AISTUDIO/resolve/refs%2Fpr%2F13/test-excel-fix.html
2.12 kB
| <html lang="vi"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Test Excel Fix</title> | |
| <script src="https://cdn.jsdelivr.net/npm/exceljs@4.4.0/dist/exceljs.min.js"></script> | |
| </head> | |
| <body> | |
| <h2>🧪 Test Excel Multi-Download Fix</h2> | |
| <button id="testBtn" onclick="testMultiDownload()">Test Excel Download</button> | |
| <p id="status">Trạng thái: Chưa test</p> | |
| <script> | |
| // Patch URL.revokeObjectURL | |
| var __VAI_BLOB_REGISTRY = { blobs: [], registry: [], isUnloading: false }; | |
| var orig = URL.revokeObjectURL; | |
| URL.revokeObjectURL = function(url) { | |
| if (!__VAI_BLOB_REGISTRY.isUnloading && url && url.startsWith('blob:')) { | |
| if (!__VAI_BLOB_REGISTRY.registry.find(e => e.url === url)) { | |
| __VAI_BLOB_REGISTRY.registry.push({ url: url, revoked: false }); | |
| } | |
| return; | |
| } | |
| return orig.apply(this, arguments); | |
| }; | |
| async function testMultiDownload() { | |
| var btn = document.getElementById('testBtn'); | |
| var status = document.getElementById('status'); | |
| try { | |
| var wb = new ExcelJS.Workbook(); | |
| var ws = wb.addWorksheet('Test'); | |
| ws.getCell('A1').value = 'TEST MULTI-DOWNLOAD - ' + new Date().toLocaleTimeString(); | |
| var buf = await wb.xlsx.writeBuffer(); | |
| var blob = new Blob([buf], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); | |
| var url = URL.createObjectURL(blob); | |
| __VAI_BLOB_REGISTRY.blobs.push({ url: url }); | |
| var a = document.createElement('a'); | |
| a.href = url; | |
| a.download = 'test_' + Date.now() + '.xlsx'; | |
| document.body.appendChild(a); | |
| a.click(); | |
| document.body.removeChild(a); | |
| status.innerHTML = '✅ Đã tải - ' + (new Date().toLocaleTimeString()) + '<br>Blob URL được bảo toàn, tải lại được!'; | |
| } catch (e) { | |
| status.innerHTML = '❌ Lỗi: ' + e.message; | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |