DeviantArt Anonymous NSFW Bypass

View NSFW submissions without having to sign in

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        DeviantArt Anonymous NSFW Bypass
// @namespace   DeviantArt
// @match       *://*.deviantart.com/*/art/*
// @grant       GM.xmlHttpRequest
// @version     1.1
// @author      lightwo <[email protected]>
// @description View NSFW submissions without having to sign in
// @license     MIT
// @icon        https://www.deviantart.com/favicon.ico
// ==/UserScript==

(function() {
  const preview = document.getElementsByClassName("mWPapz bUMYCP")[0];
  if (!document.body.contains(preview)) { return false; } // Not an NSFW submission, abort
  const wrapper = document.getElementsByClassName("rdKaY6")[0];
  const loginNag = document.getElementsByClassName("jgdbLP")[0];

  // Get the original image URL
  GM.xmlHttpRequest({
    method: "GET",
    url: "https://backend.deviantart.com/oembed?url=" + document.URL,
    onload: function(response) {
      // Set the image URL
      const origImg = JSON.parse(response.responseText).url;
      preview.style.backgroundImage = "url('" + origImg + "')";

      // Create an anchor to open/save the image
      // XXX: Figure out how to time this without a timeout;
      //      may cause issues for slow connections
      setTimeout(function(){
        const anchor = document.createElement('a');
        anchor.href = origImg;
        anchor.style.height = "100%";
        wrapper.parentNode.replaceChild(anchor, wrapper);
        anchor.appendChild(wrapper);
      }, 1000);
    }
  });

  // Remove unnecessary filters
  preview.style.filter = "unset";
  loginNag.style.display = "none";

  // Remove darken filter ::before
  const styleElem = document.head.appendChild(document.createElement("style"));
  styleElem.innerHTML = ".mWPapz::before {display: none !important;}";
})();