Greasy Fork镜像 支持简体中文。

Inoreader: enlarge images

Replaces small Blogger, Flickr, Tumblr, and NASA Earth Observatory feed images with larger ones in Inoreader.

  1. // ==UserScript==
  2. // @name Inoreader: enlarge images
  3. // @namespace https://gf.qytechs.cn/users/130-joshg253
  4. // @description Replaces small Blogger, Flickr, Tumblr, and NASA Earth Observatory feed images with larger ones in Inoreader.
  5. // @include http*://*.inoreader.com/*
  6. // @exclude none
  7. // @version 1.0.2
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. document.getElementById('reader_pane').addEventListener('DOMNodeInserted', function(e) {
  12. if(e.target.tagName && e.target.tagName == 'DIV' && /article_content/.test(e.target.className)) {
  13. var imgs = e.target.getElementsByTagName('img');
  14. for(var x in imgs) {
  15. var i = imgs[x];
  16.  
  17. //------
  18. //Tumblr
  19. //------
  20. if(/https?:\/\/.+\.tumblr\.com\/.*_500\.\w+/.test(i.src)) {
  21. console.log("found small Tumblr image: " + i.src);
  22. //i.src = i.src.replace("_500.jpg", "_1280.jpg");
  23. i.src = i.src.replace(/_500\.(\w+)$/, "_1280.$1");
  24. i.onerror = function () {
  25. this.src = this.src.replace(/_1280\.(\w+)$/, "_500.$1");
  26. }
  27. i.style.maxWidth = '100%';
  28. i.style.width = 'auto';
  29. }
  30.  
  31. //------
  32. //Flickr
  33. //------
  34. // square: _s, _q; thumbnail: _t; small: [none], _n; med: _m, _z, _c; large: _b, _h; orig: _o;
  35. else if(/https?:\/\/(.+)\.staticflickr\.com\/.*_m\.\w+/.test(i.src)) {
  36. console.log("found small Flickr image: " + i.src);
  37. //i.style.width = i.style.height = "inherit";
  38. i.src = i.src.replace(/_m\.(\w+)$/, "_b.$1");
  39. i.onerror = function () {
  40. this.src = this.src.replace(/_b\.(\w+)$/, "_m.$1");
  41. }
  42. i.style.maxWidth = '100%';
  43. i.style.width = 'auto';
  44. }
  45. else if(/https?:\/\/(.+)\.staticflickr\.com\/.*_z\.\w+/.test(i.src)) {
  46. console.log("found medium Flickr image: " + i.src);
  47. //i.style.width = i.style.height = "inherit";
  48. i.src = i.src.replace(/_z\.(\w+)$/, "_b.$1");
  49. i.onerror = function () {
  50. this.src = this.src.replace(/_b\.(\w+)$/, "_z.$1");
  51. }
  52. i.style.maxWidth = '100%';
  53. i.style.width = 'auto';
  54. }
  55. else if(/https?:\/\/(.+)\.staticflickr\.com\/.*_n\.\w+/.test(i.src)) {
  56. console.log("found small Flickr image: " + i.src);
  57. //i.style.width = i.style.height = "inherit";
  58. i.src = i.src.replace(/_n\.(\w+)$/, "_b.$1");
  59. i.onerror = function () {
  60. this.src = this.src.replace(/_b\.(\w+)$/, "_n.$1");
  61. }
  62. i.style.maxWidth = '100%';
  63. i.style.width = 'auto';
  64. }
  65.  
  66. //--------
  67. //Blogspot
  68. //--------
  69. else if(/https?:\/\/.+\.blogspot\.com\/.*\/s320\/.*\.\w+/.test(i.src)) {
  70. console.log("found small Blogspot image: " + i.src);
  71. i.src = i.src.replace("s320", "s1600");
  72. i.onerror = function () {
  73. this.src = this.src.replace("s1600", "s320");
  74. }
  75. i.style.maxWidth = '100%';
  76. i.style.width = 'auto';
  77. }
  78. else if(/https?:\/\/.+\.blogspot\.com\/.*\/s400\/.*\.\w+/.test(i.src)) {
  79. console.log("found small Blogspot image: " + i.src);
  80. i.src = i.src.replace("s400", "s1600");
  81. i.onerror = function () {
  82. this.src = this.src.replace("s1600", "s400");
  83. }
  84. i.style.maxWidth = '100%';
  85. i.style.width = 'auto';
  86. }
  87. else if(/https?:\/\/.+\.blogspot\.com\/.*\/s1600\/.*\.\w+/.test(i.src)) {
  88. console.log("found large Blogspot image: " + i.src);
  89. i.style.maxWidth = '100%';
  90. i.style.width = 'auto';
  91. }
  92.  
  93. //----------------------
  94. //NASA Earth Observatory
  95. //----------------------
  96. else if(/.*eoimages\.gsfc\.nasa\.gov.*_tn\.\w+$/.test(i.src)) {
  97. console.log("found small NASA EO image: " + i.src);
  98. i.src = i.src.replace(/_tn\.(\w+)$/, ".$1");
  99. i.onerror = function () {
  100. this.src = this.src.replace(/\.(\w+)$/, "_tn\.$1");
  101. }
  102. i.style.maxWidth = '100%';
  103. i.style.width = 'auto';
  104. }
  105. else if(/.*eoimages\.gsfc\.nasa\.gov.*_th\.\w+$/.test(i.src)) {
  106. console.log("found small NASA EO image: " + i.src);
  107. i.src = i.src.replace(/_th\.(\w+)$/, ".$1");
  108. i.onerror = function () {
  109. this.src = this.src.replace(/\.(\w+)$/, "_th\.$1");
  110. }
  111. i.style.maxWidth = '100%';
  112. i.style.width = 'auto';
  113. }
  114. }
  115. }
  116. }, false);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址