File size: 952 Bytes
6ab6993
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/**
 * V.AI STUDIO - Excel Fix Injector
 * Tự động inject fix script khi trang load
 * 
 * Cách dùng: Thêm <script src="inject-fix.js"></script> vào index.html
 */
(function(){
var f='vai-excel-fix-v2.js',l='vai-quote-excel-order-fix-v1050.js';
function chk(){return(typeof window.VAI_EXCEL_FIX!=='undefined')||document.querySelector('script[src*="vai-excel-fix"]');}
function inj(){
if(chk()){console.log('[Injector] Fix loaded');return;}
var s=document.createElement('script');
s.src='/'+f+'?v='+Date.now();
s.onload=function(){console.log('[Injector] Excel fix v2 active');};
s.onerror=function(){
console.warn('[Injector] v2 failed, fallback to legacy');
var ls=document.createElement('script');
ls.src='/'+l+'?v='+Date.now();
document.head.appendChild(ls);
};
document.head.appendChild(s);
}
if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',inj);}else{inj();}
setTimeout(inj,2e3);setTimeout(inj,5e3);
})();