I am trying to get host domain of an external script. For example:
<script src="//api.host.com/some.js">
Inside some.js:
console.log("Hi root domain, I am coming from " + document.referrer);
I want the some.js script to detect where it is hosted. Is this possible? Please help.