< Day Day Up > |
Hack 78. Bypass Weight Watchers' Browser Checker
For some reason, WeightWatchers.com doesn't like Firefox. Sadly, in 2005, there are still many sites that intentionally discriminate against minority browsers. WeightWatchers.com is one such site. The developers think they have "optimized" it for Internet Explorer, and the site intentionally shunts all other browsers to a dead-end "site requirements" page. Now, if they were doing something like using ActiveX, we would have little recourse. But they're not; they're just being stubborn. This hack bypasses their Site Requirements page and takes you to their home page, which works just fine in Firefox (and pretty much every other browser).
9.3.1. The CodeThis user script runs on all WeightWatchers.com pages, although it really does its thing only on the Site Requirements page. It parses the URL of the current page and replaces it with the actual home page that Weight Watchers takes you to when running an inferior browser. Save the following user script as weightwatchers.user.js: // ==UserScript== // @name WeightWatchers SiteRequirements Bypass // @namespace http://docs.g-blog.net/code/greasemonkey // @description Move past Weight Watchers' ridiculous browser check // @include http://weightwatchers.com/* // @include http://www.weightwatchers.com/* // ==/UserScript== // based on code by Carlo Zottmann // and included here with his gracious permission if (window.location.href.match(/siteRequirements/i)) { window.location.replace( location.href.match(/^(https?:\/\/[^\/]+)\//i)[1]+"/index.aspx"); } 9.3.2. Running the HackBefore running this hack, go to http://www.weightwatchers.com. The site will immediately redirect you to a page telling you that you are using an unsupported browser, despite listing instructions for Firefox, as shown in Figure 9-3. Figure 9-3. WeightWatchers.com site requirementsNow, install the user script (Tools Install This User Script), and revisit http://www.weightwatchers.com. Now the Unsupported Browser page redirects to the Weight Watchers home page, as shown in Figure 9-4. Figure 9-4. WeightWatchers.com home pageAs you can see, the site functions perfectly well in Firefox. Note to self: when you start your own company to take over the world, try not to upset 60 million potential customers. |
< Day Day Up > |