Overseer - Hide Requested Items

Current "Fix" to https://github.com/sct/overseerr/issues/3681

  1. // ==UserScript==
  2. // @name Overseer - Hide Requested Items
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-12-18
  5. // @description Current "Fix" to https://github.com/sct/overseerr/issues/3681
  6. // @author You
  7. // @match https://yourdomain.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
  9. // @grant none
  10. // @run-at document-idle
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Function to hide specific list items
  18. const hideListItems = () => {
  19. document.querySelectorAll('li').forEach(li => {
  20. const parentDiv = li.querySelector('div.absolute.inset-0.h-full.w-full.overflow-hidden');
  21. if (parentDiv) {
  22. const targetDiv = parentDiv.querySelector('div.absolute.left-0.right-0.flex.items-center.justify-between.p-2');
  23. if (targetDiv) {
  24. const additionalDiv = targetDiv.querySelector('div.pointer-events-none.z-40.flex.items-center');
  25. if (additionalDiv) {
  26. li.style.display = 'none';
  27. }
  28. }
  29. }
  30. });
  31. };
  32.  
  33. // Function to always show a specific button div
  34. const showButtonDiv = () => {
  35. document.querySelectorAll('div.absolute.bottom-0.left-0.right-0.flex.justify-between.px-2.py-2').forEach(buttonDiv => {
  36. buttonDiv.style.display = ''; // Removes any previous inline style that hides the element
  37. });
  38. };
  39.  
  40. // Initial invocation
  41. hideListItems();
  42. showButtonDiv();
  43.  
  44. // Observe for any added nodes to apply changes dynamically
  45. const observer = new MutationObserver(() => {
  46. hideListItems();
  47. showButtonDiv();
  48. });
  49.  
  50. observer.observe(document.body, { childList: true, subtree: true });
  51. })();