FreeLists Email Controllers

Add mailto navigation URIs to FreeLists, to subscribe or unsubscribe via an Email client, instead of HTML interface.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript== 
// @author      Schimon Jehudah, Adv.
// @description Add mailto navigation URIs to FreeLists, to subscribe or unsubscribe via an Email client, instead of HTML interface.
// @copyright   2025, Schimon Jehudah (http://schimon.i2p)
// @license     MIT
// @name        FreeLists Email Controllers
// @namespace   i2p.schimon.freelists
// @match       http://freelists.org/list/*
// @match       http://www.freelists.org/list/*
// @match       https://freelists.org/list/*
// @match       https://www.freelists.org/list/*
// @tag         mailing-list
// @version     2025.12.29
// @homepageURL https://greasyfork.org/scripts/560597-freelists-email-controllers
// @supportURL  https://greasyfork.org/scripts/560597-freelists-email-controllers/feedback
// ==/UserScript==

var mailingList = location.pathname.split("/").pop();
var elementUl = document.querySelector("div.container > div.row > div > ul");
var actions = [
  { text: "Subscribe by email", subject: "subscribe" },
  { text: "Unsubscribe by email", subject: "unsubscribe" }
];

for (var i = 0; i < actions.length; i++) {
  var listItem = document.createElement("li");
  var anchor = document.createElement("a");

  anchor.textContent = actions[i].text;
  anchor.href = "mailto:" + mailingList + "[email protected]?Subject=" + actions[i].subject;

  listItem.appendChild(document.createTextNode("» "));
  listItem.appendChild(anchor);
  elementUl.appendChild(listItem);
}