You can add the id attribute to your script tag (even if it is inside the main tag):
<script id="myscripttag" src="http://site2.com/myscript.js"></script>
and then access its src as follows:
document.getElementById("myscripttag").src
Of course, the id value should be the same for every document that your script includes, but I don't think this is a big inconvenience for you.
tsds Aug 08 2018-11-12T00: 00Z
source share