De-Junk my Chub Trunk

Bypassess login requirement, removes paid feature buttons, removes blur from NSFW images, fixes CSS, and more...

  1. // ==UserScript==
  2. // @name De-Junk my Chub Trunk
  3. // @namespace https://www.chub.ai
  4. // @match https://*.chub.ai/*
  5. // @version 1.0
  6. // @author LoafyLemon
  7. // @description Bypassess login requirement, removes paid feature buttons, removes blur from NSFW images, fixes CSS, and more...
  8. // @grant GM_addStyle
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Set the URL for redirection
  16. const subpageURL = 'https://www.chub.ai/characters?page=1&sort=last_activity_at&first=100';
  17.  
  18. // Redirect to the subpage
  19. if (window.location.pathname === '/') {
  20. window.location.href = subpageURL;
  21. }
  22.  
  23. // Define custom CSS
  24. const customCSS = `
  25. .nsfw-pixels-sm, .nsfw-pixels-lg, .nsfw-pixels-xs {
  26. -webkit-filter: none !important;
  27. filter: none !important;
  28. image-rendering: auto !important;
  29. padding: 0px !important;
  30. max-height: 600px;
  31. }
  32. .mb-4 {
  33. display: none !important;
  34. }
  35. `;
  36.  
  37. // Add custom CSS styles to the webpage
  38. GM_addStyle(customCSS);
  39.  
  40. // Function to hide elements with the class 'ant-btn' containing specific text
  41. function hideElements() {
  42. // Find all elements with class 'ant-btn'
  43. const elementsToHide = document.querySelectorAll('.ant-btn');
  44.  
  45. // Loop through each element
  46. elementsToHide.forEach(element => {
  47. // Check if the element's text content contains 'text'
  48. if (element.textContent.includes('🔒')) {
  49. // Hide the element
  50. element.style.display = 'none';
  51. }
  52. });
  53. }
  54.  
  55. // Observe changes to the DOM
  56. const observer = new MutationObserver(mutations => {
  57. mutations.forEach(mutation => {
  58. // Check if nodes were added
  59. if (mutation.addedNodes.length > 0) {
  60. // Call the function to hide elements
  61. hideElements();
  62. }
  63. });
  64. });
  65.  
  66. // Start observing the entire document for changes
  67. observer.observe(document.documentElement, {
  68. childList: true,
  69. subtree: true
  70. });
  71.  
  72. // Initially hide elements on page load
  73. hideElements();
  74. })();