Flickr get all image sizes bookmarklet

This is a bookmarklet that gives one-click access to all the Flickr image sizes on the new Flickr site. To use, click the bookmarklet when viewing an image. To install, copy the code, make a new bookmark, edit it, and paste the code into the bookmark’s address field. This has been tested on Chrome, Firefox, and Safari:

javascript: (function () {
        var url = document.URL;
        if (url.indexOf('flickr.com') >= 0) {
          try {
            pos = url.indexOf('/in/');
            if (pos > 0) {
                url = url.substring(0, pos);
            }
            newUrl = url + '/sizes/m/in/photostream/';
            window.location = newUrl;
          }
          catch(error) {
            alert('Sorry, it didn\'t work!\nYou must be on a page of a single image.');
          }
        }
        else {
          alert('You are not on flickr.com!');
        }
 }());