3 ms·
Yes, I think you could catch the error with window.onerror or script.onerror and in this handler, get the content with script.textContent or script.innerHTML.
by jraph 4y ago
Yes, I think you could catch the error with window.onerror or script.onerror and in this handler, get the content with script.textContent or script.innerHTML.
(where script is the javascript variable that corresponds to the javascript script tag, possibly initialized with script = document.createElement('script'))