Greasy Fork

Greasy Fork is available in English.

Unsub_All_by_el9in

Unsub All

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Unsub_All_by_el9in
// @namespace    Unsub_All_by_el9in
// @version      0.1
// @description  Unsub All
// @author       el9in
// @match        https://zelenka.guru/account/following
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zelenka.guru
// @grant        unsafeWindow
// @license      el9in
// ==/UserScript==

(function() {
    'use strict';
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
    const unsubButton = document.createElement('a');
    unsubButton.classList.add('button', 'red');
    unsubButton.style.padding = 'inherit';
    unsubButton.style.marginTop = '5px';
    unsubButton.textContent = 'Отписаться от всех';
    unsubButton.addEventListener('click', async function() {
        const unsubs = Array.from(document.querySelectorAll('div.extra a.UnfollowLink'));
        for(let button of unsubs) {
            button.click();
            await sleep(1000);
        }
    });
    const parentElement = document.querySelector('.mn-15-0-0');
    parentElement.appendChild(unsubButton);
})();