The DAP code breaks when the site is running at http://localhost or http://127.0.0.1, which is the base URL many developers and designers are using when working on making/editing websites.
The error shows up in the developer console like this:
The script attempts to figure out the "hostname" part of the URL through a complicated regex, followed by an array access. This line is brittle, because if the regex doesn't match on a "traditional" URL, then the resulting match won't have a [1]'th element to access, and you get the error above. Because it's a fatal error, this ceases further JavaScript execution of the remainder of the DAP snippet.
Practically speaking, this means that the DAP script doesn't run in many development environments, which means that website authors don't get a chance to observe DAP's behavior until the code and site is accessible at a traditional URL. Because developers pay closest attention to script and site behavior in development, this means that first- and second-order effects of the DAP will go missed.
As an example, this is partly why I only noticed the behavior in #13 and #15 just now, after a teammate identified the youtube.com hit on the live site, even though I'd never seen it during development.
The DAP code breaks when the site is running at
http://localhost
orhttp://127.0.0.1
, which is the base URL many developers and designers are using when working on making/editing websites.The error shows up in the developer console like this:
And it comes from this line:
The script attempts to figure out the "hostname" part of the URL through a complicated regex, followed by an array access. This line is brittle, because if the regex doesn't match on a "traditional" URL, then the resulting match won't have a
[1]
'th element to access, and you get the error above. Because it's a fatal error, this ceases further JavaScript execution of the remainder of the DAP snippet.Practically speaking, this means that the DAP script doesn't run in many development environments, which means that website authors don't get a chance to observe DAP's behavior until the code and site is accessible at a traditional URL. Because developers pay closest attention to script and site behavior in development, this means that first- and second-order effects of the DAP will go missed.
As an example, this is partly why I only noticed the behavior in #13 and #15 just now, after a teammate identified the
youtube.com
hit on the live site, even though I'd never seen it during development.