Question

Not really trying to do this, moreover I am ultimately trying to understand the structure of third party JS scripts. Can I rename the GA JS so that if someone who is using NoScript or some similar extension, the name can be changed to a domain similar name, and not managed by the Google script?

If so, why don't people do this and rename it something by their domain?

If not, is their a way to make a script that passes the necessary information to a third party JS so that you can achieve your own JS scripts on the page, and have ultimate control over the experience (either the users allos all of the scripts associated with the page, or none), ultimately providing another layer of abstraction?

Was it helpful?

Solution

For some scripts, yes, if you're willing to effectively maintain a branch of someone else's internal code.

But if the script

  1. creates an <iframe> and loads content into it from domain D,
  2. that <iframe> communicates with a web service in domain D via XHR,
  3. that web service requires cookies that are set on domain D

then no, you can't run it on your own domain because that <iframe> needs to be on the same-origin as the web service and any domain you host it on is not in that origin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top