If I have an inline script like whats below where the function foo is undefined, I want to be able to do something like:
and control what file name is displayed in the error console and/or to control what file name is passed to window.onerror when it handles the error. eg, I want to control the url param that gets sent to
window.onerror = function (errMsg, url, line) {
console.log(url); //would like this to output 'foo.js'
console.log(event.filename); //would like this to also output 'foo.js'
}
By default, unless a script links to an external file only the parent html file is listed but it would be very nice to be able to have inline code in different script tags state which script tag an error originated from.
Is there any way to do this?