Firebase authentication console - Remove all users on page

Automates removing all users (one page) in the Firebase authentication console

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Firebase authentication console - Remove all users on page
// @namespace    1N07
// @version      0.1
// @description  Automates removing all users (one page) in the Firebase authentication console
// @author       1N07
// @match        https://console.firebase.google.com/project/*/authentication/users
// @icon         https://i.imgur.com/w8CLVkE.png
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    $(function(){

        let interval = setInterval(() => {
            const place = $("user-search-bar > .search-bar-actions");
            if(place.length)
            {
                place.append(`<button class="mat-focus-indicator mat-raised-button mat-button-base mat-primary" style="background-color: red;" id="delete-all-users">DELETE ALL</button>`);
                $("#delete-all-users").click(function(){
                    if(confirm("Are you sure you want to delete all users?"))
                    {
                        $(".auth-user-table edit-account-menu").each(function(index){
                            let x = $(this);
                            setTimeout(function(){
                                x.find("button").click();
                                setTimeout(function(){$(".mat-menu-panel:visible button.mat-menu-item:contains('Delete account')").click();}, 50);
                                setTimeout(function(){$("authentication-edit-account-dialog button.confirm-button").click();}, 100);
                                setTimeout(function(){$(".users-page-content").click();}, 150);
                            }, 300*index);
                        });
                    }
                });
                clearInterval(interval);
            }
        }, 200);
    });
})();