Can't use pathname; it won't include hash or query strings

So instead, remove the `location.origin` from the `location.href` before running the regex against `location.href`, then prepend it back in after the regex has been performed.