Hide Reservable Pavilion Filter for EXPO 2025

予約可能なパビリオンに絞り込む

  1. // ==UserScript==
  2. // @name Hide Reservable Pavilion Filter for EXPO 2025
  3. // @version 1.1
  4. // @author Kdroidwin
  5. // @description 予約可能なパビリオンに絞り込む
  6. // @match https://ticket.expo2025.or.jp/*
  7. // @grant GM_addStyle
  8. // @license MIT
  9. // @namespace https://greasyfork.org/users/1344730
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 対象要素をCSSで非表示にする
  16. GM_addStyle(`
  17. .style_search_item_note__vExQQ,
  18. .style_event_links__jS3Q_,
  19. .style_search_item_row__moqWC:has(img[src*="calendar_none.svg"]) {
  20. display: none !important;
  21. }
  22. `);
  23.  
  24. // Firefoxでは :has() が使えないため、JavaScriptで対応する(オプション)
  25. const hideItems = () => {
  26. const items = document.querySelectorAll('.style_search_item_row__moqWC');
  27. items.forEach(item => {
  28. const img = item.querySelector('img[src*="calendar_none.svg"]');
  29. if (img) {
  30. item.style.display = 'none';
  31. }
  32. });
  33. };
  34.  
  35. // DOM の変化にも対応するために監視
  36. const observer = new MutationObserver(() => hideItems());
  37. observer.observe(document.body, { childList: true, subtree: true });
  38.  
  39. hideItems();
  40. })();