Add `^` to test if http is at the start of the string:

```js
href = (/^(http||https):\/\//.test(href)) ? href : 'http://' + href;
```