Greasy Fork

Greasy Fork is available in English.

display the images of tumblr in HD revolution directly

直接显示tumblr的图片为高清版

当前为 2015-08-29 提交的版本,查看 最新版本

// ==UserScript==
// @name         display the images of tumblr in HD revolution directly
// @description  直接显示tumblr的图片为高清版
// @version      1.5
// @include      http://*.tumblr.com/*
// @include      https://*.tumblr.com/*
// @author       yechenyin
// @namespace    http://greasyfork.icu/users/3586-yechenyin
// @require  	   https://code.jquery.com/jquery-1.11.2.min.js
// ==/UserScript==

$(".post_wrapper").each(function() {
  console.log($(this).find(".post_media img").length);
  if ($(this).find(".post_media img").length > 0) {
    $(this).find(".photoset_photo img").each(function() {
      if (this.src != this.parentNode.href)
      	this.src = this.parentNode.href;
    });
    $(this).find(".post_media_photo").each(function() {
      if ($(this).parent().attr("data-big-photo") && this.src != $(this).parent().attr("data-big-photo")) {
        this.src = $(this).parent().attr("data-big-photo");
        console.log(this.src);
      }
    });
    }
});


$(document).on('DOMNodeInserted', '.post_container', function(e) {
  if ($(e.target).hasClass('post_container')) {
        if ($(this).find(".post_media img").length > 0) {
          $(this).find(".photoset_photo img").each(function() {
            if (this.src != this.parentNode.href)
            	this.src = this.parentNode.href;
          });
          $(this).find(".post_media_photo").each(function() {
            if ($(this).parent().attr("data-big-photo") && this.src != $(this).parent().attr("data-big-photo")) {
              this.src = $(this).parent().attr("data-big-photo");
              console.log(this.src);
            }
          });
        }
  }
});