Last active
March 3, 2025 07:51
-
-
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 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
| 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
Well, it seems to work sometimes now after refreshing browsers and increasing the number of messages per page. Thanks for posting the code.