Firebase authentication console - Remove all users on page

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

  1. // ==UserScript==
  2. // @name Firebase authentication console - Remove all users on page
  3. // @namespace 1N07
  4. // @version 0.1
  5. // @description Automates removing all users (one page) in the Firebase authentication console
  6. // @author 1N07
  7. // @match https://console.firebase.google.com/project/*/authentication/users
  8. // @icon https://i.imgur.com/w8CLVkE.png
  9. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. $(function(){
  17.  
  18. let interval = setInterval(() => {
  19. const place = $("user-search-bar > .search-bar-actions");
  20. if(place.length)
  21. {
  22. 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>`);
  23. $("#delete-all-users").click(function(){
  24. if(confirm("Are you sure you want to delete all users?"))
  25. {
  26. $(".auth-user-table edit-account-menu").each(function(index){
  27. let x = $(this);
  28. setTimeout(function(){
  29. x.find("button").click();
  30. setTimeout(function(){$(".mat-menu-panel:visible button.mat-menu-item:contains('Delete account')").click();}, 50);
  31. setTimeout(function(){$("authentication-edit-account-dialog button.confirm-button").click();}, 100);
  32. setTimeout(function(){$(".users-page-content").click();}, 150);
  33. }, 300*index);
  34. });
  35. }
  36. });
  37. clearInterval(interval);
  38. }
  39. }, 200);
  40. });
  41. })();