Greasy Fork

Greasy Fork is available in English.

display the images of tumblr in HD revolution directly for PC and mobile

直接显示电脑版和手机版tumblr的图片为高清版

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         display the images of tumblr in HD revolution directly for PC and mobile
// @description  直接显示电脑版和手机版tumblr的图片为高清版
// @version      1.9
// @include      http://*.tumblr.com/*
// @include      https://*.tumblr.com/*
// @author       yechenyin
// @license       MIT
// @namespace    http://greasyfork.icu/users/3586-yechenyin
// @require  	   https://code.jquery.com/jquery-1.11.2.min.js
// ==/UserScript==
 
jQuery.fn.inserted = function(action) {
  var selector = this.selector;
  if ($(selector).length > 0) {
    console.log($(selector).length + ' ' + selector + " is loaded at begin");
    action.call($(selector));
  }
  var reaction = function(records) {
    records.map(function(record) {
      if (record.target !== document.body && $(record.target).find(selector).length) {
        if (record.target.id)
          console.log('#' + record.target.id + ' which contains ' + selector + ' is loaded');
        else if (record.target.className)
          console.log('#' + record.target.className + ' which contains ' + selector + ' is loaded');
        else
          console.log('#' + record.target.tagName + ' which contains ' + selector + ' is loaded');
        //if (trigger_once)
        //observer.disconnect();
        action.call($(record.target).find(selector));
      }
    });
  };
 
  var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  if (MutationObserver) {
    var observer = new MutationObserver(reaction);
    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  } else {
    //setInterval(reaction, 100);
  }
};
 
if ($('body').hasClass('is_mobile')) {
  $('.mh_post_page').inserted(function() {
    $(this).find(".media img").each(function() {
      this.src = this.src.replace(/_\d+\./, '_1280.');
    });
  });
} else {
  $(".post_wrapper, .post_container").inserted(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);
        }
      });
    }
  });
}