DeviantART - Full-Viewer March 25, 2006
Posted by Lucanos in : programming, javascript, greasemonkey , trackback“If you have 17 inches, why not use all of it?“â„¢
This GreaseMonkey userscript changes all links inside DeviantART.com and DeviouslyArtistic.com so that they point at the full-resolution image, rather than at the smaller preview page. Very handy when you are looking through alot of deviantions, as it cuts your clicks down by up to 50%! I created this userscript in August 2005. It was my first userscript, and, as such, started with a very simple, very clunky, very… inefficient way to perform the required actions. This script has been updated a number of times since then, fixing little glitches here and there.
UPDATE (2006/05/26):
Version History:
- v0.5 - 25 March 2006 Resolved a glitch which was preventing the “Move to Scraps” button from working. (It only seems to like links with “*/deviation/*” in them.)
v0.4- 22 January 2006 Resolved a long-term bug, restoring expected operations to the “Zoom Out” button.v0.3.2- 05 November 2005 (Failed) Attempt to resolve a long-term bug affecting the operations of the “Zoom Out” button.v0.3.1- 05 November 2005 (Failed) Attempt to resolve a long-term bug affecting the operations of the “Zoom Out” button.v0.2- 05 November 2005 Removed a section of the script which changed the link title. (Was part of initial debugging.)v0.1- 05 August 2005 Initial release.
How It Does What It Does:
- Create an array of all links on the page, using XPath.
- Identify the “Zoom Out” button, if present on the page
- Evaluate each of the links in turn.
- If the following conditions are matched, a replace is done changing “/deviation/” to “/view/” within the link’s href attribute.
- If there is no “Zoom Out” button OR the current link is not the “Zoom Out” button.
- If the current link does not end with “/scrap”
Enjoy!
Comments»
Great job here!, I love this script!