Fullview ANY Deviation!

By DavidJCobb Last update May 6, 2008 — Installed 712 times.
// ==UserScript==
// @name           Fullview ANY Deviation!
// @namespace      http://david.pyroboyproductions.com/
// @description    Fullview any deviation, even ones where the artist has restricted viewing to users 18+ only!
// @include        http://*.deviantart.com/art/*
// @include        http://www.deviantart.com/deviation/*
// ==/UserScript==

window.FFGM_DownloadDeviation = function() {
   if (!unsafeWindow.Deviation) return -1;

   // if we're on an MC18+, a few nodes will be missing
   // specifically, outView, zoomButton, and zoomButton's previousSibling
   // so we need to create impostors, which we'll destroy at the end of this function.
   if (!unsafeWindow.Deviation.nodes.outView) unsafeWindow.Deviation.nodes.outView=document.createElement("SPAN");
   if (!unsafeWindow.Deviation.nodes.zoomButton) unsafeWindow.Deviation.nodes.zoomButton=document.createElement("SPAN");
   if (!unsafeWindow.Deviation.nodes.zoomButton.previousSibling) { var a=document.createElement("SPAN");var b=document.createElement("DIV");b.appendChild(a);b.appendChild(unsafeWindow.Deviation.nodes.zoomButton); }
   if (unsafeWindow.Deviation.zoomIn) unsafeWindow.Deviation.zoomIn();
   if (document.getElementById("filter-warning")) document.getElementById("filter-warning").style.display="none";
   unsafeWindow.Deviation.nodes.inView.childNodes[0].src=unsafeWindow.deviantART.pageData.fullview.src;
   unsafeWindow.Deviation.nodes.outView=unsafeWindow.Deviation.nodes.zoomButton=unsafeWindow.Deviation.nodes.zoomButton.previousSibling=a=b=null;
}
unsafeWindow.FFGM_DownloadDeviation = window.FFGM_DownloadDeviation;

if (unsafeWindow.Deviation) GM_registerMenuCommand("Fullview Deviation", FFGM_DownloadDeviation);