Created
March 12, 2024 12:14
-
-
Save kyranjamie/84ddf83ec2901e08a3a517d3cf10b254 to your computer and use it in GitHub Desktop.
Script to remove all spaces from Github labels
This file contains hidden or 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
// Super hacky script to paste into dev tools to remove spaces from github labels | |
[...document.querySelectorAll(".js-label-list > div")].forEach(async (el, i) => { | |
await new Promise((resolve) => setTimeout(resolve, 400 * i)); | |
const edit = el.querySelector(".js-edit-label"); | |
edit?.click(); | |
const label = el.querySelector('[placeholder="Label name"]'); | |
const value = label?.getAttribute("value"); | |
const newValue = value?.replaceAll(' ', '') | |
console.log(newValue) | |
label?.setAttribute("value", newValue); | |
el.querySelector(".btn-primary")?.click(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment