-
Notifications
You must be signed in to change notification settings - Fork 0
/
collab-click-unread.js
21 lines (20 loc) · 1.16 KB
/
collab-click-unread.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* Click Unread script is a javascript local injection that can help navigate Collaborator reviews.
*
* How to use:
* 1. Create a new bookmark and paste the contents of the script in the URL.
* 2. Open a Collaborator review.
* 3. Click on the bookmark and it should automatically open the file which contains an unread item.
*
* Notes:
* Occasionally, the bookmark would fail to click on the next unread item. This is usually caused by a new unread item added while traversing
* the unread items sequentially. Simply refresh the page and try again.
*/
javascript: document.mainFn = function() {
document.clickUnread ? document.clickUnread : (document.unreadConvos = document.querySelectorAll("#unreadConvoId"), document.unreadCount = document.unreadConvos.length, document.unreadCounter = 0, document.clickUnread = function() {
if (document.unreadCount > 0) {
var n = document.unreadConvos[document.unreadCounter++].getElementsByTagName("a");
document.unreadCounter >= document.unreadCount && (document.unreadCounter = 0), n[0].click()
} else console.log("No unread conversations.")
}), document.clickUnread()
}, document.mainFn();