Plex Review Hide

Hides reviews from Movie view

  1. // ==UserScript==
  2. // @name Plex Review Hide
  3. // @version 0.2
  4. // @description Hides reviews from Movie view
  5. // @author Xenomer
  6. // @include /^https?://[a-zA-Z0-9.]+:32400/web/index.html/
  7. // @include http*://app.plex.tv*
  8. // @include http*://plex.*
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/696176
  11. // ==/UserScript==
  12.  
  13. const log = (...l) => console.log('[REVIEWHIDE]', ...l);
  14.  
  15. let interval = setInterval((function() {
  16. 'use strict';
  17. var xpath = "//div[text()='Reviews'][contains(@class, 'HubTitle-hubTitle')][not(contains(@style, 'hidden'))]/../..";
  18. var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  19. if(matchingElement && matchingElement.style.visibility !== 'hidden') {
  20. matchingElement.style.visibility = 'hidden';
  21. matchingElement.style.height = '0';
  22. matchingElement.style.margin = '0';
  23. log('hidden');
  24. }
  25. }), 500);