Here's the scenario, I own foo.js
, and it's being injected into random sites (let's call it cats.com).
From foo.js
, I'd like to know where foo.js
is being hosted and consumed from cats.com. For example, cats.com could do something like:
<script src="www.dogs1.com/foo.js" />
or they could do:
<script src="www.dogs2.com/foo.js />
In the first example, I'd like to print dogs1.com, and in the second I'd like to print dogs2.com. Is that possible?