ReadM Larger Thumbnails by Sapioit

Makes the thumbnails more visible by making them bigger, the text selectable, adds the code all-pages to most links, and improves/replaces the pagination.

  1. // ==UserScript==
  2. // @name ReadM Larger Thumbnails by Sapioit
  3. // @namespace Sapioit
  4. // @copyright Sapioit, 2020 - Present
  5. // @author sapioitgmail.com
  6. // @license GPL-2.0-only; http://www.gnu.org/licenses/gpl-2.0.txt
  7. // @match https://readm.org/
  8. // @match https://readm.org/latest-releases
  9. // @match https://readm.org/latest-releases/
  10. // @match https://readm.org/latest-releases/*
  11. // @match https://readm.org/manga
  12. // @match https://readm.org/manga/
  13. // @match https://readm.org/manga/*
  14. // @match https://readm.org/category
  15. // @match https://readm.org/category/
  16. // @match https://readm.org/category/*
  17. // @match https://www.readm.org/
  18. // @match https://www.readm.org/latest-releases
  19. // @match https://www.readm.org/latest-releases/
  20. // @match https://www.readm.org/latest-releases/*
  21. // @match https://www.readm.org/manga
  22. // @match https://www.readm.org/manga/
  23. // @match https://www.readm.org/manga/*
  24. // @match https://www.readm.org/category
  25. // @match https://www.readm.org/category/
  26. // @match https://www.readm.org/category/*
  27. // @description Makes the thumbnails more visible by making them bigger, the text selectable, adds the code all-pages to most links, and improves/replaces the pagination.
  28. // @version 1.9.0.03
  29. // @icon https://readm.org/favicon.ico
  30. // @grant GM_addStyle
  31. // @grant GM_registerMenuCommand
  32. // @grant GM_setValue
  33. // @grant GM_getValue
  34.  
  35.  
  36. // ==/UserScript==
  37. // @downloadURL https://gf.qytechs.cn/scripts/418848-readmg-larger-thumbnails-by-sapioit/code/ReadMG%20Larger%20Thumbnails%20by%20Sapioit.user.js
  38. // @updateURL https://openuserjs.org/install/sapioitgmail.com/ReadMG_Larger_Thumbnails_by_Sapioit.user.js
  39. /*
  40. CHANGELOG
  41.  
  42. v1.9.0.00
  43. - Mobile-friendly style optimized to show multiple manga per row.
  44.  
  45. v1.8.4.0
  46. - Fixed broken links (broken by the website admin) to manga.
  47.  
  48. v1.8.0.0
  49. - Fixed broken images (broken by the website admin), and the pagination if you are logged in (which is now required to view the links to each chapter).
  50.  
  51. v1.7.1.0
  52. - Added a special character link before each manga link, for the manga links which don't like having /all-pages at the end.
  53.  
  54.  
  55. */
  56.  
  57. /*GM_setValue(widemode,0);
  58. GM_getValue(widemode,0);*/
  59. GM_registerMenuCommand('Toggle Wide Mode', function() {
  60. GM_setValue(`widemode`,!GM_getValue(`widemode`,0));
  61. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  62. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 33%; }');
  63. GM_addStyle('#wrapper { max-width: 1280px !important; }');
  64. if(GM_getValue(`widemode`,0)){
  65. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  66. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 24%; }');
  67. GM_addStyle('#wrapper { max-width: 1600px !important; }');
  68. }
  69. });
  70.  
  71. GM_registerMenuCommand('Toggle Max-Width', function() {
  72. GM_setValue(`maxwidth`,!GM_getValue(`maxwidth`,0));
  73. GM_addStyle('.chapter a img, .chapter img { max-width: 100% !important; }');
  74. if(GM_getValue(`maxwidth`,0)){
  75. GM_addStyle('.chapter a img, .chapter img { max-width: none !important; }');
  76. }
  77. });
  78.  
  79. GM_registerMenuCommand('Refresh Thumbnails', reset_thumbnails());
  80.  
  81. function reset_thumbnails(){
  82. if (!(window.location.href.includes('readm.org/manga/'))) { return; }
  83. // Select all the elements with the CSS query
  84. let elements = document.querySelectorAll('.poster.poster-xs img');
  85. // Loop through each element
  86. elements.forEach((element) => {
  87. // Copy the 'data-src' attribute to the 'src' attribute
  88. element.src = element.dataset.src;
  89. });
  90. }
  91.  
  92. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  93. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 33%; }');
  94. GM_addStyle('#wrapper { max-width: 1280px !important; }');
  95. if(GM_getValue(`widemode`,0)){
  96. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  97. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 24%; }');
  98. GM_addStyle('#wrapper { max-width: 1600px !important; }');
  99. }
  100.  
  101. GM_addStyle('#wrapper { max-width: 1280px !important; }');
  102. if(GM_getValue(`widemode`,0)){
  103. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  104. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 24%; }');
  105. GM_addStyle('#wrapper { max-width: 1600px !important; }');
  106. }
  107.  
  108. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  109. GM_addStyle('.poster.poster-xs img { max-width: 150px !important; min-width: 150px !important; height: 212px !important; margin: 0 !important; }');
  110. GM_addStyle('.latest-updates .poster.poster-xs { height: 212px !important; }');
  111. GM_addStyle('.truncate { white-space: normal !important; }');
  112. GM_addStyle('.ui.pagination.menu .item, .ui.menu .item { margin: 0 !important; padding 10px !important; }');
  113. GM_addStyle('.poster.poster-xs a:link { color: #fff !important; }');
  114. GM_addStyle('.poster.poster-xs a:visited { color: #f6c6c6 !important; font-style: italic !important; }');
  115. GM_addStyle('ul.chapters li a:visited { color: #f6c6c6 !important; font-style: italic !important; }');
  116. GM_addStyle('ul.chapters li a:visited { color: #fcc !important; font-style: italic !important; }');
  117. GM_addStyle('a:visited { color: #fcc !important; font-style: italic !important; }');
  118. GM_addStyle('.inner-content { padding-left:0 !important; padding-right:0 !important; }');
  119. GM_addStyle('.mt-0, #series-tabs, .pb-0 { padding-left: 30px !important; padding-right: 30px !important; }');
  120. GM_addStyle('li.item { padding: 0 !important; }');
  121. GM_addStyle('li.item a { padding: .92857143em 1.14285714em !important; }');
  122. GM_addStyle('li.item a:visited { color: #fcc !important; font-style: italic !important; }');
  123. GM_addStyle('#podium-spot { display:none !important; }');
  124. GM_addStyle('body > iframe { display:none !important; }');
  125. GM_addStyle('#router-view center { display: none !important; }');
  126. GM_addStyle('#router-view div center { display: block !important; }');
  127. GM_addStyle('#router-view div[data-onpage="true"] { display: none !important; }');
  128. GM_addStyle('#gpt_unit_/30438525/Readm/ReadM_Interstitial_0 { display: none !important; }'); /*google interstitial ads*/
  129. GM_addStyle('#aniBox { display: none !important; }');
  130. GM_addStyle('.chapter center { display: none !important; }');
  131. GM_addStyle('#series-tabs > p > span[style] { color: white !important; background: #14161d !important;}');
  132. GM_addStyle('.wider-text { transform: scaleX(1.2); -webkit-transform: scaleX(1.2); -moz-transform: scaleX(1.2); -ms-transform: scaleX(1.2); }');
  133. GM_addStyle('.wider-text { transform: scaleX(2); -webkit-transform: scaleX(2); -moz-transform: scaleX(2); -ms-transform: scaleX(2); letter-spacing: -4px; }');
  134. GM_addStyle('.wider-text { padding-right: 8px; }');
  135. GM_addStyle('body::-webkit-scrollbar { width: 15px; }');
  136. GM_addStyle('body { scrollbar-width: auto; }');
  137.  
  138.  
  139. //document.getElementById("podium-spot").outerHTML = "";
  140.  
  141.  
  142. window.onload = function() {
  143. var lnks = document.querySelectorAll('.poster-xs a');
  144. console.log(lnks);
  145. for (var k = 0; k < lnks.length; k++) {
  146. if(!(lnks[k].href.includes("/all-pages"))){
  147. lnks[k].href = lnks[k].href;
  148. lnks[k].className = "manga-link";
  149. lnks[k].classList.add("manga-link");
  150. }
  151. }
  152. var lnks2 = document.querySelectorAll('.poster-xs .truncate a');
  153. console.log(lnks2);
  154. /*for (k = 0; k < lnks.length; k++) {
  155. if(!lnks[k].parentElement.parentElement.classList.contains('chapters')){
  156. lnks[k].outerHTML = "<a href=\"" + lnks[k].href.replace("/all-pages","") + "\">&#10151; </a>" + lnks[k].outerHTML;*/
  157. for (k = 0; k < lnks2.length; k++) {
  158. if(!lnks2[k].parentElement.parentElement.classList.contains('chapters')){
  159. lnks2[k].outerHTML = "<a href=\"" + lnks2[k].href + "/all-pages" + "\" class=\"wider-text\">&#10151;&#10151; </a>" + lnks2[k].outerHTML;
  160. console.log(lnks2[k].outerHTML+'<br/>\n');
  161. /* &#9686; &#10148; &#10151; */
  162. /* https://html-css-js.com/html/character-codes/arrows */
  163. }
  164. }
  165. var lnks3 = document.querySelectorAll('.poster-subject .chapters a:link');
  166. console.log(lnks);
  167. for (var l = 0; l < lnks3.length; l++) {
  168. if(!(lnks3[l].href.includes("/all-pages"))){
  169. lnks3[l].href = lnks3[l].href + "/all-pages";
  170. lnks3[l].className = "manga-chapter-link";
  171. lnks3[l].classList.add("manga-chapter-link");
  172. }
  173. }
  174. setTimeout(function() {
  175. var lnks3 = document.querySelectorAll('img.lazy-wide');
  176. //for (var h = 0; h < lnks2.length; h++) {
  177. for (var h = 0, k; h < lnks3.length; h++) {
  178. //console.log(lnks2[h].src);
  179. //lnks2[h].src=(lnks2[h].src).replace("_30x0","_198x0");
  180. //lnks2[h].setAttribute('data-src', (lnks2[h].getAttribute('data-src')).replace("_30x0","_198x0"));
  181. //lnks3[h].setAttribute('data-src', (lnks3[h].getAttribute('data-src')).replace("_30x0","_198x0"));
  182. //lnks3[h].setAttribute('src', (lnks3[h].getAttribute('src')).replace("_30x0","_198x0"));
  183. k = (lnks3[h].getAttribute('src'));
  184. //alert( k.includes("_30x0.") + '\n' + k.includes("_198x0.") + '\n' + (!(k.includes("_30x0.")) && !(k.includes("_198x0."))) );
  185. //if (h>1) break;
  186. if ( !(k.includes(".disquscdn.com/")) ) {
  187. //if ( !(k.includes("_30x0.")) && !(k.includes("_198x0.")) ) {
  188. // k = (lnks3[h].getAttribute('src')).split('.');
  189. // lnks3[h].setAttribute('src', k[0] + "_198x0." + k[1]);
  190. // k = (lnks3[h].getAttribute('data-src')).split('.');
  191. // //lnks3[h].setAttribute('data-src', k[0] + "_30x0." + k[1]);
  192. // lnks3[h].setAttribute('data-src', lnks3[h].getAttribute('data-src')[0] + "_30x0." + k[1]);
  193. // lnks3[h].setAttribute('class', "lazy-wide loaded");
  194. //}
  195. lnks3[h].setAttribute('data-src', (lnks3[h].getAttribute('data-src')).replace("_30x0","_198x0"));
  196. lnks3[h].setAttribute('src', (lnks3[h].getAttribute('src')).replace("_30x0","_198x0"));
  197. lnks3[h].setAttribute('data-src', (lnks3[h].getAttribute('data-src')).replace("_198x0_30x0","_198x0"));
  198. lnks3[h].setAttribute('src', (lnks3[h].getAttribute('src')).replace("_198x0_30x0","_198x0"));
  199. lnks3[h].setAttribute('data-src', (lnks3[h].getAttribute('data-src')).replace("_30x0_198x0","_198x0"));
  200. lnks3[h].setAttribute('src', (lnks3[h].getAttribute('src')).replace("_30x0_198x0","_198x0"));
  201. lnks3[h].setAttribute('data-src', (lnks3[h].getAttribute('data-src')).replace("_30x0_30x0","_198x0"));
  202. lnks3[h].setAttribute('src', (lnks3[h].getAttribute('src')).replace("_30x0_30x0","_198x0"));
  203. lnks3[h].setAttribute('data-src', (lnks3[h].getAttribute('data-src')).replace("_198x0_198x0","_198x0"));
  204. lnks3[h].setAttribute('src', (lnks3[h].getAttribute('src')).replace("_198x0_198x0","_198x0"));
  205. }
  206. k = lnks3[h];
  207. if (k.classList.contains('error')) {
  208. k.classList.remove('error');
  209. k.classList.add('loaded');
  210. }
  211. //console.log(lnks2[h].src);
  212. //console.log(lnks2[h].getAttribute('data-src'));
  213. //console.log(lnks2);
  214. console.log(lnks3);
  215. }
  216. }, 2*1000); // 2 second will elapse and Code will execute.
  217. }
  218.  
  219. GM_addStyle('.click-right.pageskin-click-div, .click-left.pageskin-click-div { display:none !important; }');
  220. GM_addStyle('body { background: url() #111216 !important; }');
  221.  
  222. function updatestylesbysapioit(){
  223. GM_addStyle('@media (max-width: 1000px) { .dark-segment>ul .segment-poster-sm { width: 300px !important; display: inline-block; float: left; } }');
  224. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 33%; }');
  225. GM_addStyle('#wrapper { max-width: 1280px !important; }');
  226. if(GM_getValue(`widemode`,0)){
  227. GM_addStyle('.dark-segment>ul .segment-poster-sm { width: 24%; }');
  228. GM_addStyle('#wrapper { max-width: 1600px !important; }');
  229. }
  230. GM_addStyle('.poster.poster-xs img { max-width: 150px !important; min-width: 150px !important; height: 212px !important; margin: 0 !important; }');
  231. GM_addStyle('.latest-updates .poster.poster-xs { height: 212px !important; }');
  232. GM_addStyle('.truncate { white-space: normal !important; }');
  233. GM_addStyle('.ui.pagination.menu .item, .ui.menu .item { margin: 0 !important; padding 10px !important; }');
  234. GM_addStyle('.poster.poster-xs a:link { color: #fff !important; }');
  235. GM_addStyle('.poster.poster-xs a:visited { color: #f6c6c6 !important; font-style: italic !important; }');
  236. GM_addStyle('ul.chapters li a:visited { color: #f6bf6c6c66b6 !important; font-style: italic !important; }');
  237. GM_addStyle('a:visited { color: #fcc !important; font-style: italic !important; }');
  238. GM_addStyle('.inner-content { padding-left:0 !important; padding-right:0 !important; }');
  239. GM_addStyle('.mt-0, #series-tabs, .pb-0 { padding-left: 30px !important; padding-right: 30px !important; }');
  240. //GM_addStyle('#material .scroll { overflow-y: auto; max-height: 30vh !important; }'); // MAL-Sync
  241. GM_addStyle('#podium-spot { display:none !important; }');
  242. GM_addStyle('body > iframe { display:none !important; }');
  243. //GM_addStyle('#router-view center { display: none; }');
  244. GM_addStyle('#gpt_unit_ { display:none !important; }'); /*google ads*/
  245. if(typeof document.getElementById("podium-spot") != "undefined" && document.getElementById("podium-spot") != null){
  246. document.getElementById("podium-spot").outerHTML = "";
  247. }
  248. console.log("Sapioit: updatestylesbysapioit");
  249. }
  250.  
  251. setTimeout(function() {
  252. updatestylesbysapioit();
  253. }, 5*1000); // 5 seconds will elapse and Code will execute.
  254.  
  255. setTimeout(function() {
  256. updatestylesbysapioit();
  257. }, 10*1000); // 10 seconds will elapse and Code will execute.
  258.  
  259. setTimeout(function() {
  260. updatestylesbysapioit();
  261. }, 15*1000); // 15 seconds will elapse and Code will execute.
  262.  
  263.  
  264.  
  265. setTimeout(function() { // Adds extra pages!
  266. console.log("Sapioit: pagination start");
  267. var address = document.location.pathname;
  268. if(address.startsWith("/latest-releases")){
  269. var releases_page_number = address;
  270. if(address == "/latest-releases"){
  271. releases_page_number = 0;
  272. } else {
  273. releases_page_number=address.replace("/latest-releases/", "");
  274. if (releases_page_number === '')
  275. releases_page_number = 0;
  276. releases_page_number=parseInt(releases_page_number);
  277. console.log("Sapioit: page number: " + releases_page_number);
  278. }
  279. var list_of_pages;
  280. list_of_pages = document.getElementsByClassName("menu").length;
  281. list_of_pages = document.getElementsByClassName("menu")[list_of_pages-1];
  282. var current_element_in_list = list_of_pages.getElementsByTagName("li");
  283. list_of_pages.innerHTML="";
  284. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/1">First</a></li>';
  285. if(releases_page_number>100) {
  286. } if(releases_page_number>100) {
  287. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number-100)+'"><i>'+(releases_page_number-100)+'</i></a></li>';
  288. } if(releases_page_number>50) {
  289. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number-50)+'"><i>'+(releases_page_number-50)+'</i></a></li>';
  290. } if(releases_page_number>10) {
  291. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number-10)+'"><i>'+(releases_page_number-10)+'</i></a></li>';
  292. }
  293. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number-1)+'">«</a></li>';
  294. for(var i = releases_page_number - 3; i < releases_page_number + 4; i++){
  295. if(i>-1){
  296. if(i==releases_page_number){
  297. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item active"><a data-navigo="" href="/latest-releases/'+i+'">'+i+'</a></li>';
  298. } else {
  299. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+i+'">'+i+'</a></li>';
  300. }
  301. }
  302. }
  303. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number+1)+'">»</a></li>';
  304. if (releases_page_number < 7){
  305. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/10">Tenth</a></li>';
  306. }
  307. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number+10)+'"><i>'+(releases_page_number+10)+'</i></a></li>';
  308. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number+50)+'"><i>'+(releases_page_number+50)+'</i></a></li>';
  309. list_of_pages.innerHTML=list_of_pages.innerHTML + '<li class="item"><a data-navigo="" href="/latest-releases/'+(releases_page_number+100)+'"><i>'+(releases_page_number+100)+'</i></a></li>';
  310.  
  311. console.log('' + list_of_pages + '\n\n\n');
  312. console.log(list_of_pages.innerHTML);
  313. }
  314. console.log("Sapioit: pagination end");
  315. }, 2*1000); // 2 seconds will elapse and Code will execute.
  316.  
  317.  
  318.  
  319. GM_addStyle('* { -webkit-touch-callout: text !important; -webkit-user-select: text !important; -khtml-user-select: text !important; -moz-user-select: text !important; -ms-user-select: text !important; user-select: text !important; }');
  320. /*GM_addStyle ( `
  321. * {
  322. -moz-user-select: text !important;
  323. user-select: text !important;
  324. -webkit-user-select: text !important;
  325. }
  326. ` );*/
  327.  
  328.  
  329.  

QingJ © 2025

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