PornoLab Less Spoilers

Allows to get rid of some spoilers in posts, for example in quotes

  1. // ==UserScript==
  2. // @name PornoLab Less Spoilers
  3. // @namespace copyMister
  4. // @version 1.0
  5. // @description Allows to get rid of some spoilers in posts, for example in quotes
  6. // @description:ru Позволяет убрать некоторые спойлеры в постах, например в цитатах
  7. // @author copyMister
  8. // @license MIT
  9. // @match https://pornolab.net/forum/viewtopic.php*
  10. // @match https://pornolab.net/forum/search.php*
  11. // @match https://pornolab.net/forum/privmsg.php*
  12. // @match https://pornolab.cc/forum/viewtopic.php*
  13. // @match https://pornolab.cc/forum/search.php*
  14. // @match https://pornolab.cc/forum/privmsg.php*
  15. // @match https://pornolab.biz/forum/viewtopic.php*
  16. // @match https://pornolab.biz/forum/search.php*
  17. // @match https://pornolab.biz/forum/privmsg.php*
  18. // @match https://pornolab.lib/forum/viewtopic.php*
  19. // @match https://pornolab.lib/forum/search.php*
  20. // @match https://pornolab.lib/forum/privmsg.php*
  21. // @icon https://www.google.com/s2/favicons?sz=64&domain=pornolab.net
  22. // @run-at document-body
  23. // @grant GM_addStyle
  24. // @homepageURL https://pornolab.net/forum/viewtopic.php?t=2714164
  25. // ==/UserScript==
  26.  
  27. (function() {
  28. 'use strict';
  29.  
  30. $.holdReady(true);
  31.  
  32. GM_addStyle('.q { max-height: none !important; }');
  33.  
  34. document.addEventListener('DOMContentLoaded', function() {
  35. document.querySelectorAll('.sp-body[title="Цитата"]').forEach(function(sp) {
  36. sp.firstElementChild.remove();
  37. sp.parentElement.outerHTML = sp.innerHTML;
  38. });
  39.  
  40. document.querySelectorAll(
  41. ':is(.post-user-message, .post_body) > .sp-wrap > .sp-body:is(:not([title]), [title=""])'
  42. ).forEach(function(sp) {
  43. if (sp.parentElement.parentElement.innerHTML.trim() === sp.parentElement.outerHTML.trim()) {
  44. while (sp.firstElementChild && sp.firstElementChild.classList.contains('sp-wrap')) {
  45. sp.firstElementChild.outerHTML = sp.firstElementChild.firstElementChild.innerHTML;
  46. }
  47. sp.parentElement.outerHTML = sp.innerHTML
  48. .replaceAll(/(?:Ѣ|Ѣ)/g, 'Е')
  49. .replaceAll(/(?:ѣ|ѣ)/g, 'е')
  50. .replaceAll(/(?:[ѴІ]|Ѵ|І)/g, 'И')
  51. .replaceAll(/(?:[ѵі]|ѵ|і)/g, 'и')
  52. .replaceAll(/(?:Ѿ|Ѿ)/g, 'От')
  53. .replaceAll(/(?:ѿ|ѿ)/g, 'от')
  54. .replaceAll(/ъ(&|[.,:;?!»"')\-\]]|\s|$)/gi, '$1')
  55. .trim();
  56. }
  57. });
  58.  
  59. $.holdReady(false);
  60. });
  61. })();