Created by: dburrows
When loading a create-react-app bundle from another domain everything works ok except the auto-page reload. The socket connection fails because webpackHotDevClient uses window.location to derive the socket connection url. This commit uses document.currentScript (if available) to derive the SockJS connection url details.
There's a load of ways to find the current executing script in browsers that don't support document.currentScript but they all seemed a bit fragile, so I've made a pragmatic decision to just use currentScript - main downside is that this won't work in IE but that's ok for a dev tool I think. Full support details outlined here: http://caniuse.com/#feat=document-currentscript
I've tested this by loading a normally created app and then loading the same app bundle from another domain, both worked.
P.S. Feel free to close this if you don't think it's a good idea, I'd implemented it anyway and it's quicker to open a PR with it than explain what I wanted to do ahead of time.