Disable Censorship

Disable censorship on a webpage

  1. // ==UserScript==
  2. // @name Disable Censorship
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Disable censorship on a webpage
  6. // @author Script Genius
  7. // @match *://character.ai/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Remove censorship elements
  15. function removeCensorship() {
  16. const censorshipElements = document.querySelectorAll('.censored');
  17. censorshipElements.forEach(function(element) {
  18. element.style.display = 'none';
  19. });
  20. }
  21.  
  22. // Run the script on page load
  23. window.addEventListener('load', function() {
  24. removeCensorship();
  25. });
  26.  
  27. // Run the script on DOM mutation
  28. const observer = new MutationObserver(function(mutations) {
  29. mutations.forEach(function(mutation) {
  30. if (mutation.type === 'childList') {
  31. removeCensorship();
  32. }
  33. });
  34. });
  35.  
  36. observer.observe(document.body, { childList: true, subtree: true });
  37. })();