FaceBook Delete all friends

set russian language. press START

目前為 2022-11-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         FaceBook Delete all friends
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  set russian language. press START
// @author       jmatg1
// @match        https://*.facebook.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=facebook.com
// @grant        none
// @require https://code.jquery.com/jquery-3.6.0.min.js
 // @license MIT
// ==/UserScript==
(function() {
    'use strict';

    if(!confirm('START?')) return;


    const delay = 1000;
    let scroll = 0;
    let arrayFunc = [];
    let arrayFriendsMenu = [];
    const doit = () => {
        setTimeout(() => {
            console.log(arrayFunc)
            arrayFunc[0]();
            arrayFunc = arrayFunc.slice(1);
            if(arrayFunc.length) {
                doit();
            }
        }, delay);
    }

    function sleep(sec) {
        return new Promise(resolve => setTimeout(resolve, sec * 1000));
    }

    const start = () => {
        $('[aria-label="Друзья"]').each(function(){
            const $this = $(this);
            arrayFunc.push(() => {
                $(window).scrollTop($this.offset().top - 116);
                $this.click();
            });
            arrayFunc.push(() => {
                $("span:contains('Удалить из друзей')").click();
            });
            arrayFunc.push(() => {
                $("span:contains('Подтвердить')").click();
            });
        })

           doit();
    }

    async function scan() {
        if($(document).height() == ($(document).scrollTop() + $(window).innerHeight()) || $('[aria-label="Друзья"]').length >= 9999){
           console.log('SCAN READY');
           start();
            return
        }
         $(document).scrollTop($(document).height());
        await sleep(2);
        console.log('FOUND: ', $('[aria-label="Друзья"]').length);
        scan();
    }
$( document ).ready(function() {

    scan();


});



    
})();











QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址