Freecodecamp No Popup

Removes the donate popup on FreeCodeCamp

当前为 2025-03-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Freecodecamp No Popup
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Removes the donate popup on FreeCodeCamp
  6. // @author ngocshintran
  7. // @match https://www.freecodecamp.org/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=freecodecamp.org
  9. // @grant GM_addStyle
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const observer = new MutationObserver((mutations, obs) => {
  17. const test = document.getElementById("headlessui-portal-root");
  18. if (test) {
  19. test.remove();
  20. obs.disconnect();
  21. }
  22. });
  23.  
  24. observer.observe(document, {
  25. childList: true,
  26. subtree: true
  27. });
  28. })();