Last active
November 6, 2023 13:07
-
-
Save garethrees/4dc1e78b38de2f8edbb857c4400c740e to your computer and use it in GitHub Desktop.
Print all Gmail labels
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
// Go to the Inbox | |
// Unfold label menus (only labels visible to you will be collected) | |
// Open a console | |
var elementsWithDataLabel = document.querySelectorAll('[data-label-name]'); | |
var dataLabelValues = Array.from(elementsWithDataLabel).map(el => el.getAttribute('data-label-name')); | |
dataLabelValues.forEach(value => { | |
console.log(value); | |
}); |
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
// Go to Settings -> Labels | |
// Open a console | |
let list = document.querySelectorAll(".alC"); | |
let items = Array.from(list).map(elem => { | |
console.log(elem.innerText); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment