AtCoder Customize Panel Fix

keep customize panel open when reloading standings page

目前为 2024-10-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name AtCoder Customize Panel Fix
  3. // @namespace https://fuwa.dev/
  4. // @version 0.1
  5. // @description keep customize panel open when reloading standings page
  6. // @author ibuki2003
  7. // @match https://atcoder.jp/contests/*/standings
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. const observer = new MutationObserver(function (mutations) {
  14. if (document.querySelector('#standings-panel-heading form') !== null) { // search for panel element
  15. observer.disconnect(); // only once
  16. console.table(mutations);
  17. // const v = vueStandings.filterPanelActive; // last state
  18. const v = true; // always open
  19.  
  20. vueStandings.filterPanelActive = !v;
  21. vueStandings.$nextTick(() => { // update later
  22. vueStandings.filterPanelActive = v;
  23. });
  24. console.log(v);
  25. }
  26. });
  27.  
  28. observer.observe(vueStandings.$el, {
  29. childList: true,
  30. subtree: true
  31. });
  32. })();