Greasy Fork is available in English.

Disable GitHub textarea codeframe

Disables the garbage textarea.

  1. // ==UserScript==
  2. // @name Disable GitHub textarea codeframe
  3. // @version 0.1.1
  4. // @namespace com.tasky.machine
  5. // @license MIT
  6. // @homepageURL https://github.com/taskylizard/github-remove-shit-textarea
  7. // @description Disables the garbage textarea.
  8. // @author taskylizard (https://github.com/taskylizard)
  9. // @match https://*.github.com/*
  10. // @run-at document-end
  11. // ==/UserScript==
  12.  
  13. const selector = "#read-only-cursor-text-area";
  14.  
  15. function callback(mutationList, _observer) {
  16. mutationList.forEach((mutation) => {
  17. mutation.addedNodes.forEach((node) => {
  18. if (node.querySelector && node.querySelector(selector)) {
  19. node.querySelector(selector).disabled = true;
  20. }
  21. });
  22. });
  23. }
  24.  
  25. const observer = new MutationObserver(callback);
  26.  
  27. observer.observe(document.body, {
  28. childList: true,
  29. subtree: true,
  30. });