Detect local URL from location.origin too