0

Is it possible to get the origin that a script tag was loaded from?

Note, I don't want the src of the script tag as that doesn't include redirection.

I have found post like JavaScript - How do I get the URL of script being called? but this are all based off identifying the script src rather than the origin the script was eventually loaded from

Peter Saxton
  • 4,466
  • 5
  • 33
  • 51

1 Answers1

0

No, it isn't possible.

The src is the only API provided. You can't even make a new HTTP request to it and find out that way since XMLHttpRequest and fetch follow redirects transparently.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335