Created
February 22, 2024 09:53
-
-
Save Nurgiel/318c8374d5f092e6a1a2bab3b75a89f5 to your computer and use it in GitHub Desktop.
Blackfire Delete N Profiles Bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function bulkRemove(nb) { | |
for (var i = 0; i < nb; i++) { | |
// Click on delete button | |
document.querySelector('.profile-row button.variant-secondary').click(); | |
await sleep(400); | |
// Click on modal confirmation button | |
document.querySelector('button.variant-danger').click(); | |
await sleep(1000); | |
} | |
} | |
// Ask the user for the number of profiles to remove | |
var numberOfProfiles = prompt("How many profiles do you want to remove?"); | |
if (numberOfProfiles !== null) { | |
var nb = parseInt(numberOfProfiles, 10); | |
if (!isNaN(nb)) { | |
bulkRemove(nb); | |
} else { | |
alert("Enter a valid number."); | |
} | |
} else { | |
alert("Operation cancelled."); | |
} | |
// Bookmarklet | |
// javascript:(function(){function sleep(ms){return new Promise(resolve=>setTimeout(resolve,ms));}async function bulkRemove(nb){for(var i=0;i<nb;i++){document.querySelector('.profile-row button.variant-secondary').click();await sleep(400);document.querySelector('button.variant-danger').click();await sleep(1000);}}var numberOfProfiles=prompt("How many profiles do you want to remove?");if(numberOfProfiles!==null){var nb=parseInt(numberOfProfiles,10);if(!isNaN(nb)){bulkRemove(nb);}else{alert("Please enter a valid number.");}}else{alert("Operation cancelled.");}})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment