| |
| |
| |
| |
| (function() { |
| 'use strict'; |
| |
| |
| var fixFile = 'vai-quote-excel-order-fix-v1050.js'; |
| |
| |
| function checkFixLoaded() { |
| return typeof window.VAI_FIX !== 'undefined' || |
| document.querySelector('script[src*="vai-quote-excel-order-fix"]'); |
| } |
| |
| |
| function injectFix() { |
| if (checkFixLoaded()) { |
| console.log('[Auto Loader] Fix script already loaded'); |
| return; |
| } |
| |
| var script = document.createElement('script'); |
| script.src = '/' + fixFile + '?v=' + Date.now(); |
| script.onload = function() { |
| console.log('[Auto Loader] Excel fix script loaded successfully'); |
| }; |
| script.onerror = function() { |
| console.warn('[Auto Loader] Failed to load fix script, using inline fallback'); |
| applyInlineFix(); |
| }; |
| |
| document.head.appendChild(script); |
| } |
| |
| |
| function applyInlineFix() { |
| |
| var originalRevoke = URL.revokeObjectURL; |
| URL.revokeObjectURL = function(url) { |
| if (url && url.startsWith('blob:')) { |
| setTimeout(function() { |
| try { originalRevoke.call(URL, url); } catch(e) {} |
| }, 300000); |
| return; |
| } |
| return originalRevoke.apply(this, arguments); |
| }; |
| |
| console.log('[Auto Loader] Inline fix applied'); |
| } |
| |
| |
| if (document.readyState === 'loading') { |
| document.addEventListener('DOMContentLoaded', injectFix); |
| } else { |
| injectFix(); |
| } |
| |
| |
| setTimeout(injectFix, 2000); |
| setTimeout(injectFix, 5000); |
| |
| })(); |
|
|
| |
| window.__VAI_BLOB_REGISTRY = window.__VAI_BLOB_REGISTRY || { blobs: [], registry: [], isUnloading: false }; |