Loading Audio Cutter...
/gmi, ""); const scriptContent = doc.querySelector('script') ? doc.querySelector('script').innerHTML : ''; // 2. Inject Styles and HTML into the wrapper const root = document.getElementById('audio-tool-root'); root.innerHTML = `
${bodyContent}
`; // 3. Manually execute the Audio Logic // We use a Blob to execute the script in the global scope correctly const scriptBlob = new Blob([scriptContent], { type: 'application/javascript' }); const scriptUrl = URL.createObjectURL(scriptBlob); const newScript = document.createElement('script'); newScript.src = scriptUrl; newScript.onload = () => { console.log("Audio Logic Loaded"); // Force a resize event to draw the waveform correctly once visible window.dispatchEvent(new Event('resize')); }; document.body.appendChild(newScript); }) .catch(err => { document.getElementById('audio-tool-root').innerHTML = "Error loading Audio Cutter."; console.error(err); }); })();