Last active
April 15, 2024 13:06
-
-
Save SMUsamaShah/dfcc6f709158b0adcc0a48c2d66fd353 to your computer and use it in GitHub Desktop.
Gmail sort by sender bookmarklet (drag the code to bookmark bar)
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
javascript:(function() { | |
function sortEmailsBySender() { | |
var emails = Array.from(document.querySelectorAll('.zA')); | |
emails.sort(function(a, b) { | |
var senderA = a.querySelector('.yW span').innerText.toLowerCase(); | |
var senderB = b.querySelector('.yW span').innerText.toLowerCase(); | |
return senderA.localeCompare(senderB); | |
}); | |
emails.forEach(function(email) { | |
email.parentNode.appendChild(email); | |
}); | |
} | |
sortEmailsBySender(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment