Freecodecamp No Popup

Removes the donate popup on FreeCodeCamp

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

  1. // ==UserScript==
  2. // @name Freecodecamp No Popup
  3. // @namespace https://github.com/shin-tran
  4. // @version 0.2
  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. // @supportURL https://github.com/shin-tran/freecodecamp-no-popup/issues
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. const observer = new MutationObserver((mutations, obs) => {
  18. const test = document.getElementById("headlessui-portal-root");
  19. if (test) {
  20. test.remove();
  21. obs.disconnect();
  22. }
  23. });
  24.  
  25. observer.observe(document, {
  26. childList: true,
  27. subtree: true
  28. });
  29. })();