This check probably breaks with protocol relative urls (//github.com/...), and the next line would miss an author's `<base>` element.

We should  leverage the URL utils here and let the URL parser work out what to do.
```js
var redirectedUrl = new URL(locationHeader, document.baseURI).href;
```