This is a good addition, but an odd implementation - maybe just 
```
if (url.indexOf('//') === 0) return loc.protocol + url;
```