File size: 2,084 Bytes
083c5bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
 * V.AI STUDIO - Excel Fix Checker
 * Chạy trong console (F12) để xác nhận fix đã áp dụng
 */
(function() {
    'use strict';
    
    var results = {
        blobPatched: !!window.__VAI_REVOKE_PATCHED,
        fixLoaded: !!window.VAI_FIX,
        excelJsLoaded: typeof ExcelJS !== 'undefined',
        registryExists: !!window.__VAI_BLOB_REGISTRY
    };
    
    console.log('%c[VAI FIX CHECKER] Kết quả:', 'color: #003f62; font-weight: bold; font-size: 14px');
    
    if (results.blobPatched) {
        console.log('%c✅ URL.revokeObjectURL đã được patch', 'color: #217346; font-weight: bold');
    } else {
        console.log('%c❌ URL.revokeObjectURL CHƯA patch', 'color: #dc3545; font-weight: bold');
    }
    
    if (results.fixLoaded) {
        console.log('%c✅ VAI_FIX module đã load', 'color: #217346; font-weight: bold');
    } else {
        console.log('%c❌ VAI_FIX module CHƯA load', 'color: #dc3545; font-weight: bold');
    }
    
    if (results.registryExists) {
        console.log('%c✅ Blob Registry tồn tại', 'color: #217346; font-weight: bold');
    } else {
        console.log('%c❌ Blob Registry CHƯA tồn tại', 'color: #dc3545; font-weight: bold');
    }
    
    if (results.excelJsLoaded) {
        console.log('%c✅ ExcelJS đã load', 'color: #217346; font-weight: bold');
    } else {
        console.log('%c⚠️ ExcelJS CHƯA load - đợi 2-3s', 'color: #f59e0b; font-weight: bold');
    }
    
    // Test download capability
    if (typeof window.exportDeliveryExcel === 'function' || typeof window.VAI_FIX !== 'undefined') {
        console.log('%c✅ exportDeliveryExcel đã sẵn sàng', 'color: #217346; font-weight: bold');
    }
    
    var allGood = results.blobPatched && results.fixLoaded;
    
    if (allGood) {
        alert('✅ TẤT CẢ FIX ĐÃ HOẠT ĐỘNG!\n\nBạn có thể tải Excel bao nhiêu lần tùy thích.');
    } else {
        alert('⚠️ Chưa áp dụng đủ fix. Hãy dùng bookmarklet hoặc chèn script tag.');
    }
    
    return results;
})();