Remove Google Classroom Loading Bar

Automatically removes the glitched loading bar stuck at the top of google classroom

  1. // ==UserScript==
  2. // @name Remove Google Classroom Loading Bar
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Automatically removes the glitched loading bar stuck at the top of google classroom
  6. // @match https://classroom.google.com/*
  7. // @grant none
  8. // @run-at document-start
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to start the MutationObserver once the target element is available
  16. function startObserver() {
  17. const targetNode = document.querySelector("#kO001e");
  18.  
  19. // Check if the targetNode exists before starting observation
  20. if (targetNode) {
  21. const observer = new MutationObserver((mutationsList, observer) => {
  22. // Look for the element you want to remove within the target node
  23. const element = targetNode.querySelector("div.a6pJXc.Q6ApZc.aTtRxf");
  24. if (element) {
  25. element.remove();
  26. console.log("Element removed!");
  27. }
  28. });
  29.  
  30. // Start observing the target node for changes in its children (and subtree)
  31. observer.observe(targetNode, {
  32. childList: true,
  33. subtree: true // Observe changes within all descendants of #kO001e
  34. });
  35. } else {
  36. // Retry after 500ms if the target element is not found yet
  37. setTimeout(startObserver, 500);
  38. }
  39. }
  40.  
  41. // Start the observer process
  42. startObserver();
  43.  
  44. })();