Changed .replace() from using string to regex

 To account for query strings or hashes as part of the JS url