Pretty easy to pattern match if the URL's are hardcoded and always asssigned directly to window.location, but if the pages get complicated and assign the URL to a variable and then assign that to window.location, or specify the URL + variable arguments, you'll need something that can actually parse the Javascript and run it like would if you were viewing it in a web browser. Don't know how you'd go about solving that one. Are you only trying to farm one site, or are you trying for a general solution that works on any web site?