For some unknown reason the name URL in my event handler points to a string value with the current URL of the browser instead of the constructor for an URL object. Trying to call it results in the following error:
Uncaught TypeError: URL is not a constructor
The string URL does not appear anywhere in the loaded document which leads me to believe that it is not redefined anywhere in my program. I have not been able to find anything other that would explain why this phenomena occurs.
So my question for a workaround is: Is it possible to access these global constructors in any other way?
Yes, through the name window, as long as it too hasn't been shadowed or redefined:
let a = new window.URL(location);