V.AISTUDIO / inject-fix.js
bep40's picture
Upload inject-fix.js
6ab6993 verified
Raw
History Blame
952 Bytes
/**
* 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);
})();