MeFi replace quote label

Replace the label on the quote button

当前为 2025-03-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name MeFi replace quote label
  3. // @namespace https://github.com/klipspringr/mefi-scripts
  4. // @version 2025-03-28-d
  5. // @description Replace the label on the quote button
  6. // @author Klipspringer
  7. // @supportURL https://github.com/klipspringr/mefi-scripts
  8. // @license MIT
  9. // @match *://*.metafilter.com/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. const getSetting = (key, defaultValue) => {
  14. try {
  15. return localStorage.getItem(key) || defaultValue;
  16. } catch {
  17. return defaultValue;
  18. }
  19. };
  20.  
  21. (async () => {
  22. if (!/^\/(\d|comments\.mefi)/.test(window.location.pathname)) return;
  23.  
  24. const to = getSetting("mefi-replace-quote-label", "↩ ");
  25. document
  26. .querySelectorAll('a[class="quotebutton"]')
  27. .forEach((node) => (node.textContent = to));
  28. })();