MeFi replace quote label

Replace the label on the quote button

目前為 2025-03-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         MeFi replace quote label
// @namespace    https://github.com/klipspringr/mefi-scripts
// @version      2025-03-28-d
// @description  Replace the label on the quote button
// @author       Klipspringer
// @supportURL   https://github.com/klipspringr/mefi-scripts
// @license      MIT
// @match        *://*.metafilter.com/*
// @grant        none
// ==/UserScript==

const getSetting = (key, defaultValue) => {
  try {
    return localStorage.getItem(key) || defaultValue;
  } catch {
    return defaultValue;
  }
};

(async () => {
  if (!/^\/(\d|comments\.mefi)/.test(window.location.pathname)) return;

  const to = getSetting("mefi-replace-quote-label", "↩ ");
  document
    .querySelectorAll('a[class="quotebutton"]')
    .forEach((node) => (node.textContent = to));
})();