When you add a script tag with an src field pointing to a javascript file, the browser gets it and executes it.
What I am wondering is how does this process work. Does the file get fetched and then somehow eval()'ed? Is it a mystical process that happens outside of the scope we have access? Or can we monitor/interfere this?
To explain what I want to achieve: I want to give access to third parties to customize their page on my site by linking to their own javascript files. I want to be able to centrally log any errors that prevent those external scripts from loading (i.e. their server is down, parsing errors, whatever). Is it possible?
Thanks!
- Obviously there are other ways to solve this such as hosting their scripts on my server and giving them a way to update them, but I 'm interested in knowing if my current approach is possible.
view-source:chrome://files. Take a look at this file in Chrome:view-source:chrome://resources/js/util.jsCopy and paste that into the address bar. You're looking at the Chromium Javascript "source". Wacky.view-source:chrome://sync-internals/Starting online 123(at least on mine), check out that list of internal resources and other browser scripts.